aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-23 03:18:56 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-23 03:19:35 -0500
commit82f60f0bc854aada696f27d863c03bef91f1509d (patch)
tree521fbccfc12f6c8a36f261b20eacbc84a4a31add
parentf201ae2356c74bcae130b2177b3dca903ea98071 (diff)
tracing/function-return-tracer: clean up task start/exit callbacks
Impact: cleanup Eliminate #ifdefs in core code by using empty inline functions. Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--include/linux/ftrace.h3
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/fork.c2
-rw-r--r--kernel/sched.c2
4 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 2ba259b2defa..938ca1942641 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -335,6 +335,9 @@ extern void unregister_ftrace_return(void);
335 335
336extern void ftrace_retfunc_init_task(struct task_struct *t); 336extern void ftrace_retfunc_init_task(struct task_struct *t);
337extern void ftrace_retfunc_exit_task(struct task_struct *t); 337extern void ftrace_retfunc_exit_task(struct task_struct *t);
338#else
339static inline void ftrace_retfunc_init_task(struct task_struct *t) { }
340static inline void ftrace_retfunc_exit_task(struct task_struct *t) { }
338#endif 341#endif
339 342
340#endif /* _LINUX_FTRACE_H */ 343#endif /* _LINUX_FTRACE_H */
diff --git a/kernel/exit.c b/kernel/exit.c
index b9d446329da1..ef04d03b3286 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1128,9 +1128,7 @@ NORET_TYPE void do_exit(long code)
1128 preempt_disable(); 1128 preempt_disable();
1129 /* causes final put_task_struct in finish_task_switch(). */ 1129 /* causes final put_task_struct in finish_task_switch(). */
1130 tsk->state = TASK_DEAD; 1130 tsk->state = TASK_DEAD;
1131#ifdef CONFIG_FUNCTION_RET_TRACER
1132 ftrace_retfunc_exit_task(tsk); 1131 ftrace_retfunc_exit_task(tsk);
1133#endif
1134 schedule(); 1132 schedule();
1135 BUG(); 1133 BUG();
1136 /* Avoid "noreturn function does return". */ 1134 /* Avoid "noreturn function does return". */
diff --git a/kernel/fork.c b/kernel/fork.c
index d1eb30e69ccc..fbf4a4c0a628 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1270,9 +1270,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1270 total_forks++; 1270 total_forks++;
1271 spin_unlock(&current->sighand->siglock); 1271 spin_unlock(&current->sighand->siglock);
1272 write_unlock_irq(&tasklist_lock); 1272 write_unlock_irq(&tasklist_lock);
1273#ifdef CONFIG_FUNCTION_RET_TRACER
1274 ftrace_retfunc_init_task(p); 1273 ftrace_retfunc_init_task(p);
1275#endif
1276 proc_fork_connector(p); 1274 proc_fork_connector(p);
1277 cgroup_post_fork(p); 1275 cgroup_post_fork(p);
1278 return p; 1276 return p;
diff --git a/kernel/sched.c b/kernel/sched.c
index fb17205950de..388d9db044ab 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5901,9 +5901,7 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
5901 * The idle tasks have their own, simple scheduling class: 5901 * The idle tasks have their own, simple scheduling class:
5902 */ 5902 */
5903 idle->sched_class = &idle_sched_class; 5903 idle->sched_class = &idle_sched_class;
5904#ifdef CONFIG_FUNCTION_RET_TRACER
5905 ftrace_retfunc_init_task(idle); 5904 ftrace_retfunc_init_task(idle);
5906#endif
5907} 5905}
5908 5906
5909/* 5907/*