From 431d61d802f43c734282990c3349e69369e5a455 Mon Sep 17 00:00:00 2001 From: sageweil Date: Thu, 9 Aug 2007 23:06:40 +0000 Subject: [PATCH] nicer popdump git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1614 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/sage/mds/mds/MDBalancer.cc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/branches/sage/mds/mds/MDBalancer.cc b/branches/sage/mds/mds/MDBalancer.cc index bc78db75f514b..a227886f23ba1 100644 --- a/branches/sage/mds/mds/MDBalancer.cc +++ b/branches/sage/mds/mds/MDBalancer.cc @@ -898,9 +898,7 @@ void MDBalancer::show_imports(bool external) void MDBalancer::dump_pop_map() { char fn[20]; - static int x = 0; - sprintf(fn, "popdump.%d.mds%d.%d", beat_epoch, mds->get_nodeid(), x); - x++; + sprintf(fn, "popdump.%d.mds%d", beat_epoch, mds->get_nodeid()); dout(1) << "dump_pop_map to " << fn << endl; @@ -922,19 +920,29 @@ void MDBalancer::dump_pop_map() myfile << in->popularity[a].pop[b].get(now) << "\t"; */ - // filename last - string p; - in->make_path(p); - myfile << p << endl; - // recurse, depth-first. if (in->is_dir()) { + list dirs; in->get_dirfrags(dirs); for (list::iterator p = dirs.begin(); p != dirs.end(); ++p) { CDir *dir = *p; + + myfile << (int)dir->pop_me.meta_load(now) << "\t"; + myfile << (int)dir->pop_nested.meta_load(now) << "\t"; + myfile << (int)dir->pop_auth_subtree.meta_load(now) << "\t"; + myfile << (int)dir->pop_auth_subtree_nested.meta_load(now) << "\t"; + + // filename last + string p; + in->make_path(p); + myfile << "." << p; + if (dir->get_frag() != frag_t()) + myfile << "___" << (unsigned)dir->get_frag(); + myfile << endl; //"/" << dir->get_frag() << endl; + // add contents for (map::iterator q = dir->items.begin(); q != dir->items.end(); -- 2.39.5