// ==============================================================
// debug crap
-void MDCache::show_subtrees(int dbl)
+void MDCache::show_subtrees(int dbl, bool force_print)
{
if (g_conf->mds_thrash_exports)
dbl += 15;
return;
}
+ if (!force_print && subtrees.size() > SUBTREES_COUNT_THRESHOLD &&
+ !g_conf->subsys.should_gather<ceph_subsys_mds, 25>()) {
+ dout(ceph::dout::need_dynamic(dbl)) << "number of subtrees = " << subtrees.size() << "; not "
+ "printing subtrees" << dendl;
+ return;
+ }
+
// root frags
list<CDir*> basefrags;
for (set<CInode*>::iterator p = base_inodes.begin();
set<CDir*> subtrees_seen;
- int depth = 0;
+ unsigned int depth = 0;
while (!q.empty()) {
CDir *dir = q.front().first;
- int d = q.front().second;
+ unsigned int d = q.front().second;
q.pop_front();
if (subtrees.count(dir) == 0) continue;
}
}
+ if (!force_print && depth > SUBTREES_DEPTH_THRESHOLD &&
+ !g_conf->subsys.should_gather<ceph_subsys_mds, 25>()) {
+ dout(ceph::dout::need_dynamic(dbl)) << "max depth among subtrees = " << depth << "; not printing "
+ "subtrees" << dendl;
+ return;
+ }
// print tree
for (list<CDir*>::iterator p = basefrags.begin(); p != basefrags.end(); ++p)
// -- subtrees --
+private:
+ static const unsigned int SUBTREES_COUNT_THRESHOLD = 5;
+ static const unsigned int SUBTREES_DEPTH_THRESHOLD = 5;
protected:
/* subtree keys and each tree's non-recursive nested subtrees (the "bounds") */
map<CDir*,set<CDir*> > subtrees;
// == crap fns ==
public:
void show_cache();
- void show_subtrees(int dbl=10);
+ void show_subtrees(int dbl=10, bool force_print=false);
CInode *hack_pick_random_inode() {
assert(!inode_map.empty());