aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/libspl/assert.c9
-rw-r--r--lib/libspl/include/assert.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/libspl/assert.c b/lib/libspl/assert.c
index 5b12c14ac..79b640d89 100644
--- a/lib/libspl/assert.c
+++ b/lib/libspl/assert.c
@@ -55,7 +55,7 @@
#define UNW_LOCAL_ONLY
#include <libunwind.h>
-static inline void
+void
libspl_dump_backtrace(void)
{
unw_context_t uc;
@@ -85,7 +85,7 @@ libspl_dump_backtrace(void)
#elif defined(HAVE_BACKTRACE)
#include <execinfo.h>
-static inline void
+void
libspl_dump_backtrace(void)
{
void *btptrs[100];
@@ -97,7 +97,10 @@ libspl_dump_backtrace(void)
free(bt);
}
#else
-#define libspl_dump_backtrace()
+void
+libspl_dump_backtrace(void)
+{
+}
#endif
#if defined(__APPLE__)
diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h
index 155bbab30..126f2db24 100644
--- a/lib/libspl/include/assert.h
+++ b/lib/libspl/include/assert.h
@@ -60,6 +60,8 @@ libspl_assert(const char *buf, const char *file, const char *func, int line)
return (0);
}
+extern void libspl_dump_backtrace(void);
+
#ifdef verify
#undef verify
#endif