From: Sage Weil Date: Thu, 28 Jan 2010 18:04:28 +0000 (-0800) Subject: dout: print thread id hex (to match up with gdb) X-Git-Tag: v0.20~431^2~38 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a68274ffff7d6f9fd71df5f4f8ffc82994a8c9b;p=ceph.git dout: print thread id hex (to match up with gdb) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 9de38063c9cd..a2367cb0f7aa 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -63,7 +63,7 @@ using namespace std; #define DOUT_SUBSYS client #undef dout_prefix -#define dout_prefix *_dout << dbeginl << pthread_self() << " client" << whoami << " " +#define dout_prefix *_dout << dbeginl << std::hex << pthread_self() << std::dec << " client" << whoami << " " #define tout if (g_conf.client_trace) traceout diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index 13d3ee8dff8e..0d0b1589082a 100644 --- a/src/common/Mutex.cc +++ b/src/common/Mutex.cc @@ -15,8 +15,8 @@ int g_lockdep = 0; #undef dout #undef derr -#define dout(l) if (l<=g_conf.debug_lockdep) *_dout << g_clock.now() << " " << pthread_self() << " lockdep: " -#define derr(l) if (l<=g_conf.debug_lockdep) *_derr << g_clock.now() << " " << pthread_self() << " lockdep: " +#define dout(l) if (l<=g_conf.debug_lockdep) *_dout << g_clock.now() << " " << std::hex << pthread_self() << std::dec << " lockdep: " +#define derr(l) if (l<=g_conf.debug_lockdep) *_derr << g_clock.now() << " " << std::hex << pthread_self() << std::dec << " lockdep: " pthread_mutex_t lockdep_mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index a349f2df21ae..40f17e3c346a 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -19,7 +19,7 @@ #define DOUT_SUBSYS tp #undef dout_prefix -#define dout_prefix *_dout << dbeginl << pthread_self() << " " << name << " " +#define dout_prefix *_dout << dbeginl << std::hex << pthread_self() << std::dec << " " << name << " " void ThreadPool::worker() diff --git a/src/common/debug.h b/src/common/debug.h index d47861dfa413..e748e9548b87 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -69,8 +69,8 @@ inline ostream& operator<<(ostream& out, _bad_endl_use_dendl_t) { // generic macros -#define generic_dout(x) do { if ((x) <= g_conf.debug) { *_dout << dbeginl -#define generic_derr(x) do { if ((x) <= g_conf.debug) { *_derr << dbeginl +#define generic_dout(x) do { if ((x) <= g_conf.debug) { *_dout << dbeginl << std::hex << pthread_self() << std::dec << " " +#define generic_derr(x) do { if ((x) <= g_conf.debug) { *_derr << dbeginl << std::hex << pthread_self() << std::dec << " " #define pdout(x,p) do { if ((x) <= (p)) { *_dout << dbeginl diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 93829cd7e8c4..8b37dc18dd8e 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -10,7 +10,7 @@ #include "config.h" #undef dout -#define dout(l) if (l<=g_conf.debug_lockdep) *_dout << g_clock.now() << " " << pthread_self() << " lockdep: " +#define dout(l) if (l<=g_conf.debug_lockdep) *_dout << g_clock.now() << " " << std::hex << pthread_self() << std::dec << " lockdep: " // global diff --git a/src/common/tls.cc b/src/common/tls.cc index f272dabcd8fc..3c6f9c76b9f0 100644 --- a/src/common/tls.cc +++ b/src/common/tls.cc @@ -8,8 +8,8 @@ #undef dout #undef derr -#define dout(l) if (l<=g_conf.debug_lockdep) *_dout << g_clock.now() << " " << pthread_self() << " tls: " -#define derr(l) if (l<=g_conf.debug_lockdep) *_derr << g_clock.now() << " " << pthread_self() << " tls: " +#define dout(l) if (l<=g_conf.debug_lockdep) *_dout << g_clock.now() << " " << std::hex << pthread_self() << std::dec << " tls: " +#define derr(l) if (l<=g_conf.debug_lockdep) *_derr << g_clock.now() << " " << std::hex << pthread_self() << std::dec << " tls: " pthread_key_t _tls_key = 0; diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 812b50e9d92c..9920a6ff6904 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -40,7 +40,7 @@ #undef dout_prefix #define dout_prefix _prefix(messenger) static ostream& _prefix(SimpleMessenger *messenger) { - return *_dout << dbeginl << pthread_self() << " -- " << messenger->ms_addr << " "; + return *_dout << dbeginl << std::hex << pthread_self() << std::dec << " -- " << messenger->ms_addr << " "; } @@ -465,7 +465,7 @@ entity_addr_t SimpleMessenger::get_myaddr() #undef dout_prefix #define dout_prefix _pipe_prefix() ostream& SimpleMessenger::Pipe::_pipe_prefix() { - return *_dout << dbeginl << pthread_self() + return *_dout << dbeginl << std::hex << pthread_self() << std::dec << " -- " << messenger->ms_addr << " >> " << peer_addr << " pipe(" << this << " sd=" << sd << " pgs=" << peer_global_seq diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index f7b0b17a0e8a..030eb56ecdc4 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -24,7 +24,7 @@ #define DOUT_SUBSYS journal #undef dout_prefix -#define dout_prefix *_dout << dbeginl << pthread_self() << " journal " +#define dout_prefix *_dout << dbeginl << std::hex << pthread_self() << std::dec << " journal " int FileJournal::_open(bool forwrite, bool create) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index c64aaf4c0e67..eeac8db53bc5 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -62,7 +62,7 @@ #define DOUT_SUBSYS filestore #undef dout_prefix -#define dout_prefix *_dout << dbeginl << pthread_self() << " filestore(" << basedir << ") " +#define dout_prefix *_dout << dbeginl << std::hex << pthread_self() << std::dec << " filestore(" << basedir << ") " #include "include/buffer.h" diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 63ef4d9cdd3f..e2d3add6a16f 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -99,7 +99,7 @@ #define dout_prefix _prefix(*_dout, whoami, osdmap) static ostream& _prefix(ostream& out, int whoami, OSDMap *osdmap) { - return out << dbeginl << pthread_self() + return out << dbeginl << std::hex << pthread_self() << std::dec << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " "; } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ec67aa5cfc74..d4898bbf6d0a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -36,7 +36,7 @@ #undef dout_prefix #define dout_prefix _prefix(this, osd->whoami, osd->osdmap) static ostream& _prefix(PG *pg, int whoami, OSDMap *osdmap) { - return *_dout << dbeginl<< pthread_self() << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " << *pg << " "; + return *_dout << dbeginl<< std::hex << pthread_self() << std::dec << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " << *pg << " "; } diff --git a/src/osd/RAID4PG.cc b/src/osd/RAID4PG.cc index 1ca57352f6d4..9f49a6fb30cb 100644 --- a/src/osd/RAID4PG.cc +++ b/src/osd/RAID4PG.cc @@ -28,7 +28,7 @@ #undef dout_prefix #define dout_prefix _prefix(this, osd->whoami, osd->osdmap) static ostream& _prefix(PG *pg, int whoami, OSDMap *osdmap) { - return *_dout << dbeginl << pthread_self() + return *_dout << dbeginl << std::hex << pthread_self() << std::dec << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " << *pg << " "; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 91854cbd850e..c1c0e0fef6d9 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -38,7 +38,7 @@ #undef dout_prefix #define dout_prefix _prefix(this, osd->whoami, osd->osdmap) static ostream& _prefix(PG *pg, int whoami, OSDMap *osdmap) { - return *_dout << dbeginl << pthread_self() << " osd" << whoami + return *_dout << dbeginl << std::hex << pthread_self() << std::dec << " osd" << whoami << " " << (osdmap ? osdmap->get_epoch():0) << " " << *pg << " "; }