From: Sage Weil Date: Tue, 1 Aug 2017 20:05:03 +0000 (-0400) Subject: osd/crush/CrushWrapper: include CLASS column in 'osd crush tree' X-Git-Tag: v12.1.3~112^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1e757ded33ff5d0c9defe3baa5b14206245026bc;p=ceph-ci.git osd/crush/CrushWrapper: include CLASS column in 'osd crush tree' Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 2891056c905..bcafc178049 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -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) {