lkml.org 
[lkml]   [2020]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 09/14] tools/lib/lockdep: New stacktrace API
Date
The kernel switched to using kernel/stacktrace.c, and the API slightly
changed.

Adjust it to make stack traces work again.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/linux/stacktrace.h | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/tools/include/linux/stacktrace.h b/tools/include/linux/stacktrace.h
index ae343ac35bfa7..b290b98d883aa 100644
--- a/tools/include/linux/stacktrace.h
+++ b/tools/include/linux/stacktrace.h
@@ -15,10 +15,18 @@ static inline void print_stack_trace(struct stack_trace *trace, int spaces)
backtrace_symbols_fd((void **)trace->entries, trace->nr_entries, 1);
}

+static inline void stack_trace_print(const long unsigned int *entries, unsigned int nr, int spaces)
+{
+ backtrace_symbols_fd((void **)entries, nr, 1);
+}
+
#define save_stack_trace(trace) \
((trace)->nr_entries = \
backtrace((void **)(trace)->entries, (trace)->max_entries))

+#define stack_trace_save(e, m, x) \
+ backtrace((void **)(e), (m))
+
static inline int dump_stack(void)
{
void *array[64];
--
2.25.1
\
 
 \ /
  Last update: 2020-08-05 02:12    [W:0.081 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site