]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
lockdep: dump lock names if we run out of IDs
authorSage Weil <sage@redhat.com>
Fri, 29 Jan 2016 17:40:43 +0000 (12:40 -0500)
committerSage Weil <sage@redhat.com>
Mon, 1 Feb 2016 20:02:37 +0000 (15:02 -0500)
..just in case we are doing something silly, like misnaming locks.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/lockdep.cc

index 66e1c07fcdf11e70a0754d9c60b1d25848a48964..18b0845b98087e35cba1653347c1e664f619538b 100644 (file)
@@ -138,7 +138,14 @@ int lockdep_register(const char *name)
   pthread_mutex_lock(&lockdep_mutex);
   ceph::unordered_map<std::string, int>::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();