summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/backtrace.c')
-rw-r--r--src/vppinfra/backtrace.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vppinfra/backtrace.c b/src/vppinfra/backtrace.c
index e713bae6876..bae563d04b0 100644
--- a/src/vppinfra/backtrace.c
+++ b/src/vppinfra/backtrace.c
@@ -219,8 +219,17 @@ backtrace_done:
#ifndef clib_backtrace_defined
#define clib_backtrace_defined
+#ifndef USE_LIBUNWIND
/* use glibc backtrace for stack trace */
#include <execinfo.h>
+#else
+#include <libunwind.h>
+static int
+backtrace (void **buffer, int size)
+{
+ return unw_backtrace (buffer, size);
+}
+#endif
__clib_export uword
clib_backtrace (uword * callers, uword max_callers, uword n_frames_to_skip)