1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LIBLOCKDEP_LINUX_STACKTRACE_H_
3 #define _LIBLOCKDEP_LINUX_STACKTRACE_H_
8 unsigned int nr_entries, max_entries;
9 unsigned long *entries;
13 static inline void print_stack_trace(struct stack_trace *trace, int spaces)
15 backtrace_symbols_fd((void **)trace->entries, trace->nr_entries, 1);
18 #define save_stack_trace(trace) \
19 ((trace)->nr_entries = \
20 backtrace((void **)(trace)->entries, (trace)->max_entries))
22 static inline int dump_stack(void)
27 size = backtrace(array, 64);
28 backtrace_symbols_fd(array, size, 1);