Commit | Line | Data |
---|---|---|
8637c099 IM |
1 | #ifndef __LINUX_STACKTRACE_H |
2 | #define __LINUX_STACKTRACE_H | |
3 | ||
9a92a6ce JK |
4 | #include <linux/types.h> |
5 | ||
897312bd | 6 | struct task_struct; |
9c0729dc | 7 | struct pt_regs; |
897312bd | 8 | |
8637c099 IM |
9 | #ifdef CONFIG_STACKTRACE |
10 | struct stack_trace { | |
11 | unsigned int nr_entries, max_entries; | |
12 | unsigned long *entries; | |
5a1b3999 | 13 | int skip; /* input argument: How many entries to skip */ |
8637c099 IM |
14 | }; |
15 | ||
ab1b6f03 | 16 | extern void save_stack_trace(struct stack_trace *trace); |
39581062 MH |
17 | extern void save_stack_trace_regs(struct pt_regs *regs, |
18 | struct stack_trace *trace); | |
9745512c AV |
19 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
20 | struct stack_trace *trace); | |
8637c099 IM |
21 | |
22 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | |
9a92a6ce JK |
23 | extern int snprint_stack_trace(char *buf, size_t size, |
24 | struct stack_trace *trace, int spaces); | |
02b67518 | 25 | |
8d26487f | 26 | #ifdef CONFIG_USER_STACKTRACE_SUPPORT |
02b67518 TE |
27 | extern void save_stack_trace_user(struct stack_trace *trace); |
28 | #else | |
29 | # define save_stack_trace_user(trace) do { } while (0) | |
30 | #endif | |
31 | ||
8637c099 | 32 | #else |
ab1b6f03 | 33 | # define save_stack_trace(trace) do { } while (0) |
9745512c | 34 | # define save_stack_trace_tsk(tsk, trace) do { } while (0) |
8d7c6a96 | 35 | # define save_stack_trace_user(trace) do { } while (0) |
3b5ad079 | 36 | # define print_stack_trace(trace, spaces) do { } while (0) |
9a92a6ce | 37 | # define snprint_stack_trace(buf, size, trace, spaces) do { } while (0) |
8637c099 IM |
38 | #endif |
39 | ||
40 | #endif |