Commit ff1be5d9 authored by Rich Prohaska's avatar Rich Prohaska

#198 add tokudb_backtrace to help debug handler interface bugs

parent 0e147881
...@@ -202,6 +202,11 @@ PATENT RIGHTS GRANT: ...@@ -202,6 +202,11 @@ PATENT RIGHTS GRANT:
#ifndef _TOKUDB_DEBUG_H #ifndef _TOKUDB_DEBUG_H
#define _TOKUDB_DEBUG_H #define _TOKUDB_DEBUG_H
#define TOKU_INCLUDE_BACKTRACE 0
#if TOKU_INCLUDE_BACKTRACE
static void tokudb_backtrace(void);
#endif
extern ulong tokudb_debug; extern ulong tokudb_debug;
// tokudb debug tracing // tokudb debug tracing
......
...@@ -316,6 +316,7 @@ static void handle_ydb_error(int error) { ...@@ -316,6 +316,7 @@ static void handle_ydb_error(int error) {
static int tokudb_init_func(void *p) { static int tokudb_init_func(void *p) {
TOKUDB_DBUG_ENTER(""); TOKUDB_DBUG_ENTER("");
int r; int r;
#if defined(_WIN64) #if defined(_WIN64)
...@@ -2211,6 +2212,16 @@ static SHOW_VAR toku_global_status_variables_export[]= { ...@@ -2211,6 +2212,16 @@ static SHOW_VAR toku_global_status_variables_export[]= {
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
}; };
#if TOKU_INCLUDE_BACKTRACE
#include <execinfo.h>
static void tokudb_backtrace(void) {
const int N_POINTERS = 30;
void *backtrace_pointers[N_POINTERS];
int n = backtrace(backtrace_pointers, N_POINTERS);
backtrace_symbols_fd(backtrace_pointers, n, fileno(stderr));
}
#endif
mysql_declare_plugin(tokudb) mysql_declare_plugin(tokudb)
{ {
MYSQL_STORAGE_ENGINE_PLUGIN, MYSQL_STORAGE_ENGINE_PLUGIN,
......
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