From e7b451941b92e2bdbb9c08bb4283c9a39d5571c6 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 10 May 2024 10:19:48 +1000 Subject: 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 Signed-off-by: Rob Norris Closes #16181 --- cmd/zdb/zdb.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'cmd/zdb') 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 #include #include -#if (__GLIBC__ && !__UCLIBC__) -#include /* for backtrace() */ -#endif #include #include @@ -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(); /* -- cgit v1.2.3