diff options
author | Rich Prohaska <prohaska@tokutek.com> | 2014-03-12 10:28:57 -0400 |
---|---|---|
committer | Rich Prohaska <prohaska@tokutek.com> | 2014-03-12 10:28:57 -0400 |
commit | d4962b93aa7ae0545708324856e3238c0d380055 (patch) | |
tree | 7a7e8deb279024d389597ace25f9b9f15e4e2921 /storage | |
parent | bbef719666aca3f6067af95d9d45b230a0f02e37 (diff) | |
download | mariadb-git-d4962b93aa7ae0545708324856e3238c0d380055.tar.gz |
#198 add tokudb_backtrace to help debug handler interface bugs
Diffstat (limited to 'storage')
-rw-r--r-- | storage/tokudb/hatoku_defines.h | 5 | ||||
-rw-r--r-- | storage/tokudb/hatoku_hton.cc | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h index fcebf4eab45..5b8c632d529 100644 --- a/storage/tokudb/hatoku_defines.h +++ b/storage/tokudb/hatoku_defines.h @@ -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 diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 58201a7a46e..37d8d83f043 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -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, |