aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ftrace.h10
-rw-r--r--include/linux/ring_buffer.h1
-rw-r--r--include/linux/sched.h36
-rw-r--r--include/linux/seq_file.h1
-rw-r--r--include/linux/stacktrace.h8
5 files changed, 44 insertions, 12 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index f7ba4ea5e128..7854d87b97b2 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -257,6 +257,7 @@ extern int ftrace_dump_on_oops;
257 257
258extern void tracing_start(void); 258extern void tracing_start(void);
259extern void tracing_stop(void); 259extern void tracing_stop(void);
260extern void ftrace_off_permanent(void);
260 261
261extern void 262extern void
262ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); 263ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
@@ -290,6 +291,7 @@ ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));
290 291
291static inline void tracing_start(void) { } 292static inline void tracing_start(void) { }
292static inline void tracing_stop(void) { } 293static inline void tracing_stop(void) { }
294static inline void ftrace_off_permanent(void) { }
293static inline int 295static inline int
294ftrace_printk(const char *fmt, ...) 296ftrace_printk(const char *fmt, ...)
295{ 297{
@@ -323,6 +325,8 @@ struct ftrace_retfunc {
323}; 325};
324 326
325#ifdef CONFIG_FUNCTION_RET_TRACER 327#ifdef CONFIG_FUNCTION_RET_TRACER
328#define FTRACE_RETFUNC_DEPTH 50
329#define FTRACE_RETSTACK_ALLOC_SIZE 32
326/* Type of a callback handler of tracing return function */ 330/* Type of a callback handler of tracing return function */
327typedef void (*trace_function_return_t)(struct ftrace_retfunc *); 331typedef void (*trace_function_return_t)(struct ftrace_retfunc *);
328 332
@@ -330,6 +334,12 @@ extern int register_ftrace_return(trace_function_return_t func);
330/* The current handler in use */ 334/* The current handler in use */
331extern trace_function_return_t ftrace_function_return; 335extern trace_function_return_t ftrace_function_return;
332extern void unregister_ftrace_return(void); 336extern void unregister_ftrace_return(void);
337
338extern void ftrace_retfunc_init_task(struct task_struct *t);
339extern void ftrace_retfunc_exit_task(struct task_struct *t);
340#else
341static inline void ftrace_retfunc_init_task(struct task_struct *t) { }
342static inline void ftrace_retfunc_exit_task(struct task_struct *t) { }
333#endif 343#endif
334 344
335#endif /* _LINUX_FTRACE_H */ 345#endif /* _LINUX_FTRACE_H */
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index e097c2e6b6dc..3bb87a753fa3 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -122,6 +122,7 @@ void ring_buffer_normalize_time_stamp(int cpu, u64 *ts);
122 122
123void tracing_on(void); 123void tracing_on(void);
124void tracing_off(void); 124void tracing_off(void);
125void tracing_off_permanent(void);
125 126
126enum ring_buffer_flags { 127enum ring_buffer_flags {
127 RB_FL_OVERWRITE = 1 << 0, 128 RB_FL_OVERWRITE = 1 << 0,
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c8e0db464206..d02a0ca70ee9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -96,6 +96,7 @@ struct exec_domain;
96struct futex_pi_state; 96struct futex_pi_state;
97struct robust_list_head; 97struct robust_list_head;
98struct bio; 98struct bio;
99struct bts_tracer;
99 100
100/* 101/*
101 * List of flags we want to share for kernel threads, 102 * List of flags we want to share for kernel threads,
@@ -1161,6 +1162,18 @@ struct task_struct {
1161 struct list_head ptraced; 1162 struct list_head ptraced;
1162 struct list_head ptrace_entry; 1163 struct list_head ptrace_entry;
1163 1164
1165#ifdef CONFIG_X86_PTRACE_BTS
1166 /*
1167 * This is the tracer handle for the ptrace BTS extension.
1168 * This field actually belongs to the ptracer task.
1169 */
1170 struct bts_tracer *bts;
1171 /*
1172 * The buffer to hold the BTS data.
1173 */
1174 void *bts_buffer;
1175#endif /* CONFIG_X86_PTRACE_BTS */
1176
1164 /* PID/PID hash table linkage. */ 1177 /* PID/PID hash table linkage. */
1165 struct pid_link pids[PIDTYPE_MAX]; 1178 struct pid_link pids[PIDTYPE_MAX];
1166 struct list_head thread_group; 1179 struct list_head thread_group;
@@ -1352,6 +1365,17 @@ struct task_struct {
1352 unsigned long default_timer_slack_ns; 1365 unsigned long default_timer_slack_ns;
1353 1366
1354 struct list_head *scm_work_list; 1367 struct list_head *scm_work_list;
1368#ifdef CONFIG_FUNCTION_RET_TRACER
1369 /* Index of current stored adress in ret_stack */
1370 int curr_ret_stack;
1371 /* Stack of return addresses for return function tracing */
1372 struct ftrace_ret_stack *ret_stack;
1373 /*
1374 * Number of functions that haven't been traced
1375 * because of depth overrun.
1376 */
1377 atomic_t trace_overrun;
1378#endif
1355}; 1379};
1356 1380
1357/* 1381/*
@@ -2006,18 +2030,6 @@ static inline void setup_thread_stack(struct task_struct *p, struct task_struct
2006{ 2030{
2007 *task_thread_info(p) = *task_thread_info(org); 2031 *task_thread_info(p) = *task_thread_info(org);
2008 task_thread_info(p)->task = p; 2032 task_thread_info(p)->task = p;
2009
2010#ifdef CONFIG_FUNCTION_RET_TRACER
2011 /*
2012 * When fork() creates a child process, this function is called.
2013 * But the child task may not inherit the return adresses traced
2014 * by the return function tracer because it will directly execute
2015 * in userspace and will not return to kernel functions its parent
2016 * used.
2017 */
2018 task_thread_info(p)->curr_ret_stack = -1;
2019 atomic_set(&task_thread_info(p)->trace_overrun, 0);
2020#endif
2021} 2033}
2022 2034
2023static inline unsigned long *end_of_stack(struct task_struct *p) 2035static inline unsigned long *end_of_stack(struct task_struct *p)
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index dc50bcc282a8..b3dfa72f13b9 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -34,6 +34,7 @@ struct seq_operations {
34 34
35#define SEQ_SKIP 1 35#define SEQ_SKIP 1
36 36
37char *mangle_path(char *s, char *p, char *esc);
37int seq_open(struct file *, const struct seq_operations *); 38int seq_open(struct file *, const struct seq_operations *);
38ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); 39ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);
39loff_t seq_lseek(struct file *, loff_t, int); 40loff_t seq_lseek(struct file *, loff_t, int);
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index b106fd8e0d5c..1a8cecc4f38c 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -15,9 +15,17 @@ extern void save_stack_trace_tsk(struct task_struct *tsk,
15 struct stack_trace *trace); 15 struct stack_trace *trace);
16 16
17extern void print_stack_trace(struct stack_trace *trace, int spaces); 17extern void print_stack_trace(struct stack_trace *trace, int spaces);
18
19#ifdef CONFIG_USER_STACKTRACE_SUPPORT
20extern void save_stack_trace_user(struct stack_trace *trace);
21#else
22# define save_stack_trace_user(trace) do { } while (0)
23#endif
24
18#else 25#else
19# define save_stack_trace(trace) do { } while (0) 26# define save_stack_trace(trace) do { } while (0)
20# define save_stack_trace_tsk(tsk, trace) do { } while (0) 27# define save_stack_trace_tsk(tsk, trace) do { } while (0)
28# define save_stack_trace_user(trace) do { } while (0)
21# define print_stack_trace(trace, spaces) do { } while (0) 29# define print_stack_trace(trace, spaces) do { } while (0)
22#endif 30#endif
23 31