]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/crush/CrushWrapper: include CLASS column in 'osd crush tree'
authorSage Weil <sage@redhat.com>
Tue, 1 Aug 2017 20:05:03 +0000 (16:05 -0400)
committerSage Weil <sage@redhat.com>
Tue, 1 Aug 2017 20:05:03 +0000 (16:05 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/crush/CrushWrapper.cc

index 2891056c90564c9e431b7d35ca44d14a68f5fc62..bcafc17804987fe1f20050776db252aa4b26c6a2 100644 (file)
@@ -2650,6 +2650,7 @@ public:
 
   void dump(TextTable *tbl) {
     tbl->define_column("ID", TextTable::LEFT, TextTable::RIGHT);
+    tbl->define_column("CLASS", TextTable::LEFT, TextTable::RIGHT);
     tbl->define_column("WEIGHT", TextTable::LEFT, TextTable::RIGHT);
     for (auto& p : crush->choose_args) {
       if (p.first == CrushWrapper::DEFAULT_CHOOSE_ARGS) {
@@ -2668,7 +2669,11 @@ public:
 
 protected:
   void dump_item(const CrushTreeDumper::Item &qi, TextTable *tbl) override {
+    const char *c = crush->get_item_class(qi.id);
+    if (!c)
+      c = "";
     *tbl << qi.id
+        << c
         << weightf_t(qi.weight);
     for (auto& p : crush->choose_args) {
       if (qi.parent < 0) {