From ada41f469eacfb274383a35c8b2c07b583652882 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 29 Jan 2016 12:40:43 -0500 Subject: [PATCH] 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 --- src/common/lockdep.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 66e1c07fcdf..18b0845b980 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(); -- 2.39.5