Commit 3527f774 authored by Rich Prohaska's avatar Rich Prohaska

#198 add tokudb_backtrace to help debug handler interface bugs

parent 4e6d8249
......@@ -202,6 +202,11 @@ PATENT RIGHTS GRANT:
#ifndef _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;
// tokudb debug tracing
......
......@@ -316,6 +316,7 @@ static void handle_ydb_error(int error) {
static int tokudb_init_func(void *p) {
TOKUDB_DBUG_ENTER("");
int r;
#if defined(_WIN64)
......@@ -2211,6 +2212,16 @@ static SHOW_VAR toku_global_status_variables_export[]= {
{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_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