Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / x86 / include / asm / stacktrace.h
1 #ifndef _ASM_X86_STACKTRACE_H
2 #define _ASM_X86_STACKTRACE_H
3
4 extern int kstack_depth_to_print;
5
6 int x86_is_stack_id(int id, char *name);
7
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
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
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);
37         void (*address)(void *data, unsigned long address, int reliable);
38         /* On negative return stop dumping */
39         int (*stack)(void *data, char *name);
40         walk_stack_t    walk_stack;
41 };
42
43 void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
44                 unsigned long *stack, unsigned long bp,
45                 const struct stacktrace_ops *ops, void *data);
46
47 #endif /* _ASM_X86_STACKTRACE_H */