H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_STACKTRACE_H |
| 2 | #define _ASM_X86_STACKTRACE_H |
Andi Kleen | c0b766f | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 3 | |
Chuck Ebbert | 0741f4d | 2006-12-07 02:14:11 +0100 | [diff] [blame] | 4 | extern int kstack_depth_to_print; |
| 5 | |
Frederic Weisbecker | 0406ca6 | 2009-07-01 21:02:09 +0200 | [diff] [blame] | 6 | int x86_is_stack_id(int id, char *name); |
| 7 | |
Frederic Weisbecker | 61c1917 | 2009-12-17 05:40:33 +0100 | [diff] [blame] | 8 | struct thread_info; |
| 9 | struct stacktrace_ops; |
| 10 | |
| 11 | typedef unsigned long (*walk_stack_t)(struct thread_info *tinfo, |
| 12 | unsigned long *stack, |
| 13 | unsigned long bp, |
| 14 | const struct stacktrace_ops *ops, |
| 15 | void *data, |
| 16 | unsigned long *end, |
| 17 | int *graph); |
| 18 | |
| 19 | extern unsigned long |
| 20 | print_context_stack(struct thread_info *tinfo, |
| 21 | unsigned long *stack, unsigned long bp, |
| 22 | const struct stacktrace_ops *ops, void *data, |
| 23 | unsigned long *end, int *graph); |
| 24 | |
Frederic Weisbecker | 06d65bd | 2009-12-17 05:40:34 +0100 | [diff] [blame] | 25 | extern unsigned long |
| 26 | print_context_stack_bp(struct thread_info *tinfo, |
| 27 | unsigned long *stack, unsigned long bp, |
| 28 | const struct stacktrace_ops *ops, void *data, |
| 29 | unsigned long *end, int *graph); |
| 30 | |
Andi Kleen | c0b766f | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 31 | /* Generic stack tracer with callbacks */ |
| 32 | |
| 33 | struct stacktrace_ops { |
| 34 | void (*warning)(void *data, char *msg); |
| 35 | /* msg must contain %s for the symbol */ |
| 36 | void (*warning_symbol)(void *data, char *msg, unsigned long symbol); |
Arjan van de Ven | bc850d6 | 2008-01-30 13:33:07 +0100 | [diff] [blame] | 37 | void (*address)(void *data, unsigned long address, int reliable); |
Andi Kleen | c0b766f | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 38 | /* On negative return stop dumping */ |
| 39 | int (*stack)(void *data, char *name); |
Frederic Weisbecker | 61c1917 | 2009-12-17 05:40:33 +0100 | [diff] [blame] | 40 | walk_stack_t walk_stack; |
Andi Kleen | c0b766f | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 41 | }; |
| 42 | |
Arjan van de Ven | bc850d6 | 2008-01-30 13:33:07 +0100 | [diff] [blame] | 43 | void dump_trace(struct task_struct *tsk, struct pt_regs *regs, |
| 44 | unsigned long *stack, unsigned long bp, |
Jan Beulich | 9689ba8 | 2007-10-17 18:04:37 +0200 | [diff] [blame] | 45 | const struct stacktrace_ops *ops, void *data); |
Andi Kleen | c0b766f | 2006-09-26 10:52:34 +0200 | [diff] [blame] | 46 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 47 | #endif /* _ASM_X86_STACKTRACE_H */ |