Ingo Molnar | 8637c09 | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 1 | #ifndef __LINUX_STACKTRACE_H |
| 2 | #define __LINUX_STACKTRACE_H |
| 3 | |
Andrew Morton | 897312b | 2008-10-03 15:23:41 -0700 | [diff] [blame] | 4 | struct task_struct; |
| 5 | |
Ingo Molnar | 8637c09 | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 6 | #ifdef CONFIG_STACKTRACE |
| 7 | struct stack_trace { |
| 8 | unsigned int nr_entries, max_entries; |
| 9 | unsigned long *entries; |
Andi Kleen | 5a1b399 | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 10 | int skip; /* input argument: How many entries to skip */ |
Ingo Molnar | 8637c09 | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 11 | }; |
| 12 | |
Christoph Hellwig | ab1b6f0 | 2007-05-08 00:23:29 -0700 | [diff] [blame] | 13 | extern void save_stack_trace(struct stack_trace *trace); |
Arjan van de Ven | 9745512 | 2008-01-25 21:08:34 +0100 | [diff] [blame] | 14 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
| 15 | struct stack_trace *trace); |
Ingo Molnar | 8637c09 | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 16 | |
| 17 | extern void print_stack_trace(struct stack_trace *trace, int spaces); |
| 18 | #else |
Christoph Hellwig | ab1b6f0 | 2007-05-08 00:23:29 -0700 | [diff] [blame] | 19 | # define save_stack_trace(trace) do { } while (0) |
Arjan van de Ven | 9745512 | 2008-01-25 21:08:34 +0100 | [diff] [blame] | 20 | # define save_stack_trace_tsk(tsk, trace) do { } while (0) |
Johannes Berg | 3b5ad07 | 2007-07-19 01:49:02 -0700 | [diff] [blame] | 21 | # define print_stack_trace(trace, spaces) do { } while (0) |
Ingo Molnar | 8637c09 | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 22 | #endif |
| 23 | |
| 24 | #endif |