]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/stacktrace.h
UBUNTU: SAUCE: LSM stacking: procfs: add smack subdir to attrs
[mirror_ubuntu-artful-kernel.git] / include / linux / stacktrace.h
CommitLineData
8637c099
IM
1#ifndef __LINUX_STACKTRACE_H
2#define __LINUX_STACKTRACE_H
3
9a92a6ce
JK
4#include <linux/types.h>
5
897312bd 6struct task_struct;
9c0729dc 7struct pt_regs;
897312bd 8
8637c099
IM
9#ifdef CONFIG_STACKTRACE
10struct stack_trace {
11 unsigned int nr_entries, max_entries;
12 unsigned long *entries;
5a1b3999 13 int skip; /* input argument: How many entries to skip */
8637c099
IM
14};
15
ab1b6f03 16extern void save_stack_trace(struct stack_trace *trace);
39581062
MH
17extern void save_stack_trace_regs(struct pt_regs *regs,
18 struct stack_trace *trace);
9745512c
AV
19extern void save_stack_trace_tsk(struct task_struct *tsk,
20 struct stack_trace *trace);
af085d90
JP
21extern int save_stack_trace_tsk_reliable(struct task_struct *tsk,
22 struct stack_trace *trace);
8637c099
IM
23
24extern void print_stack_trace(struct stack_trace *trace, int spaces);
9a92a6ce
JK
25extern int snprint_stack_trace(char *buf, size_t size,
26 struct stack_trace *trace, int spaces);
02b67518 27
8d26487f 28#ifdef CONFIG_USER_STACKTRACE_SUPPORT
02b67518
TE
29extern void save_stack_trace_user(struct stack_trace *trace);
30#else
31# define save_stack_trace_user(trace) do { } while (0)
32#endif
33
af085d90 34#else /* !CONFIG_STACKTRACE */
ab1b6f03 35# define save_stack_trace(trace) do { } while (0)
9745512c 36# define save_stack_trace_tsk(tsk, trace) do { } while (0)
8d7c6a96 37# define save_stack_trace_user(trace) do { } while (0)
3b5ad079 38# define print_stack_trace(trace, spaces) do { } while (0)
9a92a6ce 39# define snprint_stack_trace(buf, size, trace, spaces) do { } while (0)
af085d90
JP
40# define save_stack_trace_tsk_reliable(tsk, trace) ({ -ENOSYS; })
41#endif /* CONFIG_STACKTRACE */
8637c099 42
af085d90 43#endif /* __LINUX_STACKTRACE_H */