xtensa: support DMA buffers in high memory
[cris-mirror.git] / tools / include / linux / stacktrace.h
blobae343ac35bfa7e6c1df4c129639b1b47b8a0a5c1
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LIBLOCKDEP_LINUX_STACKTRACE_H_
3 #define _LIBLOCKDEP_LINUX_STACKTRACE_H_
5 #include <execinfo.h>
7 struct stack_trace {
8 unsigned int nr_entries, max_entries;
9 unsigned long *entries;
10 int skip;
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)
24 void *array[64];
25 size_t size;
27 size = backtrace(array, 64);
28 backtrace_symbols_fd(array, size, 1);
30 return 0;
33 #endif