blob: 25310f1d7f3773c540e51e7103a4edfa98db7a33 [file] [log] [blame]
Ingo Molnar8637c092006-07-03 00:24:38 -07001#ifndef __LINUX_STACKTRACE_H
2#define __LINUX_STACKTRACE_H
3
Andrew Morton897312b2008-10-03 15:23:41 -07004struct task_struct;
Soeren Sandmann Pedersen9c0729d2010-11-05 05:59:39 -04005struct pt_regs;
Andrew Morton897312b2008-10-03 15:23:41 -07006
Ingo Molnar8637c092006-07-03 00:24:38 -07007#ifdef CONFIG_STACKTRACE
Vegard Nossumb618ad32008-06-13 15:31:11 +02008struct task_struct;
9
Ingo Molnar8637c092006-07-03 00:24:38 -070010struct stack_trace {
11 unsigned int nr_entries, max_entries;
12 unsigned long *entries;
Andi Kleen5a1b3992006-09-26 10:52:34 +020013 int skip; /* input argument: How many entries to skip */
Ingo Molnar8637c092006-07-03 00:24:38 -070014};
15
Christoph Hellwigab1b6f02007-05-08 00:23:29 -070016extern void save_stack_trace(struct stack_trace *trace);
Soeren Sandmann Pedersen9c0729d2010-11-05 05:59:39 -040017extern void save_stack_trace_regs(struct stack_trace *trace,
18 struct pt_regs *regs);
Arjan van de Ven97455122008-01-25 21:08:34 +010019extern void save_stack_trace_tsk(struct task_struct *tsk,
20 struct stack_trace *trace);
Ingo Molnar8637c092006-07-03 00:24:38 -070021
22extern void print_stack_trace(struct stack_trace *trace, int spaces);
Török Edwin02b67512008-11-22 13:28:47 +020023
Török Edwin8d264872008-11-23 12:39:08 +020024#ifdef CONFIG_USER_STACKTRACE_SUPPORT
Török Edwin02b67512008-11-22 13:28:47 +020025extern void save_stack_trace_user(struct stack_trace *trace);
26#else
27# define save_stack_trace_user(trace) do { } while (0)
28#endif
29
Ingo Molnar8637c092006-07-03 00:24:38 -070030#else
Christoph Hellwigab1b6f02007-05-08 00:23:29 -070031# define save_stack_trace(trace) do { } while (0)
Arjan van de Ven97455122008-01-25 21:08:34 +010032# define save_stack_trace_tsk(tsk, trace) do { } while (0)
Török Edwin8d7c6a92008-11-23 12:39:06 +020033# define save_stack_trace_user(trace) do { } while (0)
Johannes Berg3b5ad072007-07-19 01:49:02 -070034# define print_stack_trace(trace, spaces) do { } while (0)
Ingo Molnar8637c092006-07-03 00:24:38 -070035#endif
36
37#endif