{
cout << "usage: crushtool ...\n";
cout << " --decompile|-d map decompile a crush map to source\n";
+ cout << " --tree print map summary as a tree\n";
cout << " --compile|-c map.txt compile a map from source\n";
cout << " [-o outfile [--clobber]]\n";
cout << " specify output for for (de)compilation\n";
bool decompile = false;
bool test = false;
bool display = false;
+ bool tree = false;
int full_location = -1;
bool write_to_file = false;
int verbose = 0;
outfn = val;
} else if (ceph_argparse_flag(args, i, "-v", "--verbose", (char*)NULL)) {
verbose += 1;
+ } else if (ceph_argparse_flag(args, i, "--tree", (char*)NULL)) {
+ tree = true;
} else if (ceph_argparse_flag(args, i, "--show_utilization", (char*)NULL)) {
display = true;
tester.set_output_utilization(true);
cerr << "cannot specify more than one of compile, decompile, and build" << std::endl;
exit(EXIT_FAILURE);
}
- if (!compile && !decompile && !build && !test && !reweight && !adjust &&
+ if (!compile && !decompile && !build && !test && !reweight && !adjust && !tree &&
add_item < 0 && full_location < 0 &&
remove_name.empty() && reweight_name.empty()) {
cerr << "no action specified; -h for help" << std::endl;
cc.decompile(cout);
}
}
+ if (tree) {
+ ostringstream oss;
+ crush.dump_tree(&oss, NULL);
+ dout(1) << "\n" << oss.str() << dendl;
+ }
if (compile) {
crush.create();
{
ostringstream oss;
- vector<__u32> weights(crush.get_max_devices(), 0x10000);
- crush.dump_tree(weights, &oss, NULL);
+ crush.dump_tree(&oss, NULL);
dout(1) << "\n" << oss.str() << dendl;
}