]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: print thread ID in sig handlers and assert
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 3 Jan 2011 20:22:56 +0000 (12:22 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 3 Jan 2011 20:22:56 +0000 (12:22 -0800)
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
src/common/assert.cc
src/config.cc

index ca28bbf77679449a642f5dc4a2cb8f5ee49ba5ca..e80cb362972681ce73f575ffd04fbd27e2f95415 100644 (file)
@@ -13,7 +13,8 @@ void __ceph_assert_fail(const char *assertion, const char *file, int line, const
   BackTrace *bt = new BackTrace(1);
 
   _dout_lock.Lock();
-  *_dout << file << ": In function '" << func << "':" << std::endl;
+  *_dout << file << ": In function '" << func << "', "
+        << "In thread " << pthread_self() << std::endl;
   *_dout << file << ":" << line << ": FAILED assert(" << assertion << ")" << std::endl;
   bt->print(*_dout);
   *_dout << " NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this." << std::endl;
index 12b135b75838a50978ea792356125c75bc339250..cf0333511bb008bc1eeb4fb018d931940ea23895 100644 (file)
@@ -243,6 +243,7 @@ void handle_fatal_signal(int signum)
 {
   *_dout << "*** Caught signal (" << sys_siglist[signum] << ") ***"
         << std::endl;
+  *_dout << "in thread " << pthread_self() << std::endl;
   BackTrace bt(0);
   bt.print(*_dout);
   _dout->flush();