diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-01-27 15:32:29 +0100 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-01-27 15:32:37 +0100 |
commit | b8e6a6bd5301acfd51fc4e9652757b56c26a7401 (patch) | |
tree | be0ca65ecf94a68a04d76be471aa94143de6154c | |
parent | filestore: fix typo (diff) | |
download | ceph-b8e6a6bd5301acfd51fc4e9652757b56c26a7401.tar.xz ceph-b8e6a6bd5301acfd51fc4e9652757b56c26a7401.zip |
assert: include timestamp
Also drop quotes around thread id.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
-rw-r--r-- | src/ceph_mds.cc | 1 | ||||
-rw-r--r-- | src/common/assert.cc | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index 02195b21c12..c7ea08a19f9 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -134,6 +134,7 @@ int main(int argc, const char **argv) int rank = -1; std::string dump_file; + assert(0); std::string val, action; for (std::vector<const char*>::iterator i = args.begin(); i != args.end(); ) { if (ceph_argparse_double_dash(args, i)) { diff --git a/src/common/assert.cc b/src/common/assert.cc index c525665ef9d..e1c1734c791 100644 --- a/src/common/assert.cc +++ b/src/common/assert.cc @@ -16,6 +16,7 @@ #include "common/ceph_context.h" #include "common/config.h" #include "common/debug.h" +#include "common/Clock.h" #include "include/assert.h" #include <errno.h> @@ -49,12 +50,16 @@ namespace ceph { g_assert_context->dout_trylock(&dout_locker); } + ostringstream tss; + tss << ceph_clock_now(g_assert_context); + char buf[8096]; BackTrace *bt = new BackTrace(1); snprintf(buf, sizeof(buf), - "%s: In function '%s', in thread '%llx'\n" + "%s: In function '%s' thread %llx time %s\n" "%s: %d: FAILED assert(%s)\n", - file, func, (unsigned long long)pthread_self(), file, line, assertion); + file, func, (unsigned long long)pthread_self(), tss.str().c_str(), + file, line, assertion); dout_emergency(buf); // TODO: get rid of this memory allocation. |