aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zdb
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2024-05-10 10:19:48 +1000
committerBrian Behlendorf <[email protected]>2024-05-14 09:48:39 -0700
commite7b451941b92e2bdbb9c08bb4283c9a39d5571c6 (patch)
treea7e54040925a9adeecffc1cb0a9475e0eab554a0 /cmd/zdb
parent91c46d4399e42b2b14ae65ae8637061b67adbd82 (diff)
zdb/ztest: use libspl backtrace for crashes
We can show much nicer backtraces these days, lets use them. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #16181
Diffstat (limited to 'cmd/zdb')
-rw-r--r--cmd/zdb/zdb.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index f3274a65d..908e4e0ab 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -85,9 +85,6 @@
#include <sys/brt_impl.h>
#include <zfs_comutil.h>
#include <sys/zstd/zstd.h>
-#if (__GLIBC__ && !__UCLIBC__)
-#include <execinfo.h> /* for backtrace() */
-#endif
#include <libnvpair.h>
#include <libzutil.h>
@@ -843,18 +840,11 @@ dump_debug_buffer(void)
zfs_dbgmsg_print("zdb");
}
-#define BACKTRACE_SZ 100
-
static void sig_handler(int signo)
{
struct sigaction action;
-#if (__GLIBC__ && !__UCLIBC__) /* backtrace() is a GNU extension */
- int nptrs;
- void *buffer[BACKTRACE_SZ];
- nptrs = backtrace(buffer, BACKTRACE_SZ);
- backtrace_symbols_fd(buffer, nptrs, STDERR_FILENO);
-#endif
+ libspl_dump_backtrace();
dump_debug_buffer();
/*