blob: 551f6c7d50443d22ba04439d572823a6a66e7529 [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;
5
Ingo Molnar8637c092006-07-03 00:24:38 -07006#ifdef CONFIG_STACKTRACE
7struct stack_trace {
8 unsigned int nr_entries, max_entries;
9 unsigned long *entries;
Andi Kleen5a1b3992006-09-26 10:52:34 +020010 int skip; /* input argument: How many entries to skip */
Ingo Molnar8637c092006-07-03 00:24:38 -070011};
12
Christoph Hellwigab1b6f02007-05-08 00:23:29 -070013extern void save_stack_trace(struct stack_trace *trace);
Vegard Nossumacc6be52008-05-20 11:15:43 +020014extern void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp);
Arjan van de Ven97455122008-01-25 21:08:34 +010015extern void save_stack_trace_tsk(struct task_struct *tsk,
16 struct stack_trace *trace);
Ingo Molnar8637c092006-07-03 00:24:38 -070017
18extern void print_stack_trace(struct stack_trace *trace, int spaces);
Török Edwin02b67512008-11-22 13:28:47 +020019
Török Edwin8d264872008-11-23 12:39:08 +020020#ifdef CONFIG_USER_STACKTRACE_SUPPORT
Török Edwin02b67512008-11-22 13:28:47 +020021extern void save_stack_trace_user(struct stack_trace *trace);
22#else
23# define save_stack_trace_user(trace) do { } while (0)
24#endif
25
Ingo Molnar8637c092006-07-03 00:24:38 -070026#else
Christoph Hellwigab1b6f02007-05-08 00:23:29 -070027# define save_stack_trace(trace) do { } while (0)
Arjan van de Ven97455122008-01-25 21:08:34 +010028# define save_stack_trace_tsk(tsk, trace) do { } while (0)
Török Edwin8d7c6a92008-11-23 12:39:06 +020029# define save_stack_trace_user(trace) do { } while (0)
Johannes Berg3b5ad072007-07-19 01:49:02 -070030# define print_stack_trace(trace, spaces) do { } while (0)
Ingo Molnar8637c092006-07-03 00:24:38 -070031#endif
32
33#endif