Commit ee8724e7 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3028] Merge from tokudb.3028 with command svn merge -r25427:HEAD ../tokudb.3028 .

Add engine status on failed assert.  Also add panic info to log status in preparation for making available via engine status.

git-svn-id: file:///svn/toku/tokudb@25469 c7de825b-a66e-492c-adef-691d508d4ae1
parent ab102ae7
......@@ -1355,11 +1355,15 @@ toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS s) {
s->ilock_ctr = logger->input_lock_ctr;
s->olock_ctr = logger->output_condition_lock_ctr;
s->swap_ctr = logger->swap_ctr;
s->panicked = logger->is_panicked;
s->panic_errno = logger->panic_errno;
}
else {
s->ilock_ctr = 0;
s->olock_ctr = 0;
s->swap_ctr = 0;
s->panicked = 0;
s->panic_errno = 0;
}
}
......
......@@ -168,6 +168,8 @@ typedef struct logger_status {
u_int64_t ilock_ctr;
u_int64_t olock_ctr;
u_int64_t swap_ctr;
u_int64_t panicked;
u_int64_t panic_errno;
} LOGGER_STATUS_S, *LOGGER_STATUS;
void toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS s);
......
This diff is collapsed.
......@@ -17,6 +17,8 @@
static void *backtrace_pointers[N_POINTERS];
#endif
int (*toku_maybe_get_engine_status_text_p)(char* buff, int buffsize); // tentative definition: if linked to ydb, will have non-zero value
void (*do_assert_hook)(void) = NULL;
static void toku_do_backtrace_abort(void) __attribute__((noreturn));
......@@ -32,6 +34,19 @@ toku_do_backtrace_abort(void) {
#endif
fflush(stderr);
if (toku_maybe_get_engine_status_text_p) {
int r;
int buffsize = 1024 * 32;
char buff[buffsize];
r = toku_maybe_get_engine_status_text_p(buff, buffsize);
fprintf(stderr, "Engine status:\n%s\n", buff);
}
else
fprintf(stderr, "Engine status function not available\n");
fflush(stderr);
#if TOKU_WINDOWS
//Following commented methods will not always end the process (could hang).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment