1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_STACKTRACE_H
3 #define __LINUX_STACKTRACE_H
5 #include <linux/types.h>
10 #ifdef CONFIG_STACKTRACE
12 unsigned int nr_entries
, max_entries
;
13 unsigned long *entries
;
14 int skip
; /* input argument: How many entries to skip */
17 extern void save_stack_trace(struct stack_trace
*trace
);
18 extern void save_stack_trace_regs(struct pt_regs
*regs
,
19 struct stack_trace
*trace
);
20 extern void save_stack_trace_tsk(struct task_struct
*tsk
,
21 struct stack_trace
*trace
);
22 extern int save_stack_trace_tsk_reliable(struct task_struct
*tsk
,
23 struct stack_trace
*trace
);
25 extern void print_stack_trace(struct stack_trace
*trace
, int spaces
);
26 extern int snprint_stack_trace(char *buf
, size_t size
,
27 struct stack_trace
*trace
, int spaces
);
29 #ifdef CONFIG_USER_STACKTRACE_SUPPORT
30 extern void save_stack_trace_user(struct stack_trace
*trace
);
32 # define save_stack_trace_user(trace) do { } while (0)
35 #else /* !CONFIG_STACKTRACE */
36 # define save_stack_trace(trace) do { } while (0)
37 # define save_stack_trace_tsk(tsk, trace) do { } while (0)
38 # define save_stack_trace_user(trace) do { } while (0)
39 # define print_stack_trace(trace, spaces) do { } while (0)
40 # define snprint_stack_trace(buf, size, trace, spaces) do { } while (0)
41 # define save_stack_trace_tsk_reliable(tsk, trace) ({ -ENOSYS; })
42 #endif /* CONFIG_STACKTRACE */
44 #endif /* __LINUX_STACKTRACE_H */