From: Sage Weil Date: Fri, 29 Jan 2016 17:40:43 +0000 (-0500) Subject: lockdep: dump lock names if we run out of IDs X-Git-Tag: v10.0.4~82^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ada41f469eacfb274383a35c8b2c07b583652882;p=ceph.git lockdep: dump lock names if we run out of IDs ..just in case we are doing something silly, like misnaming locks. Signed-off-by: Sage Weil --- diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 66e1c07fcdf1..18b0845b9808 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -138,7 +138,14 @@ int lockdep_register(const char *name) pthread_mutex_lock(&lockdep_mutex); ceph::unordered_map::iterator p = lock_ids.find(name); if (p == lock_ids.end()) { - assert(!free_ids.empty()); + if (free_ids.empty()) { + lockdep_dout(0) << "ERROR OUT OF IDS .. have " << free_ids.size() + << " max " << MAX_LOCKS << dendl; + for (auto& p : lock_names) { + lockdep_dout(0) << " lock " << p.first << " " << p.second << dendl; + } + assert(free_ids.empty()); + } id = free_ids.front(); free_ids.pop_front();