aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_sched_switch.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 15:20:52 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 15:04:44 -0400
commit4e65551905fb0300ae7e667cbaa41ee2e3f29a13 (patch)
tree0e642c311e31043eecf86c218128c40e1ddac782 /kernel/trace/trace_sched_switch.c
parent4c1f4d4f0175129934d5dbc19a39296430937a05 (diff)
ftrace: sched tracer, trace full rbtree
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/trace_sched_switch.c')
-rw-r--r--kernel/trace/trace_sched_switch.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
index 8b1cf1a3aee..12658b3f2b2 100644
--- a/kernel/trace/trace_sched_switch.c
+++ b/kernel/trace/trace_sched_switch.c
@@ -18,7 +18,7 @@ static struct trace_array *ctx_trace;
18static int __read_mostly tracer_enabled; 18static int __read_mostly tracer_enabled;
19 19
20static void 20static void
21ctx_switch_func(struct task_struct *prev, struct task_struct *next) 21ctx_switch_func(void *__rq, struct task_struct *prev, struct task_struct *next)
22{ 22{
23 struct trace_array *tr = ctx_trace; 23 struct trace_array *tr = ctx_trace;
24 struct trace_array_cpu *data; 24 struct trace_array_cpu *data;
@@ -34,14 +34,17 @@ ctx_switch_func(struct task_struct *prev, struct task_struct *next)
34 data = tr->data[cpu]; 34 data = tr->data[cpu];
35 disabled = atomic_inc_return(&data->disabled); 35 disabled = atomic_inc_return(&data->disabled);
36 36
37 if (likely(disabled == 1)) 37 if (likely(disabled == 1)) {
38 tracing_sched_switch_trace(tr, data, prev, next, flags); 38 tracing_sched_switch_trace(tr, data, prev, next, flags);
39 ftrace_all_fair_tasks(__rq, tr, data);
40 }
39 41
40 atomic_dec(&data->disabled); 42 atomic_dec(&data->disabled);
41 local_irq_restore(flags); 43 local_irq_restore(flags);
42} 44}
43 45
44static void wakeup_func(struct task_struct *wakee, struct task_struct *curr) 46static void
47wakeup_func(void *__rq, struct task_struct *wakee, struct task_struct *curr)
45{ 48{
46 struct trace_array *tr = ctx_trace; 49 struct trace_array *tr = ctx_trace;
47 struct trace_array_cpu *data; 50 struct trace_array_cpu *data;
@@ -57,14 +60,18 @@ static void wakeup_func(struct task_struct *wakee, struct task_struct *curr)
57 data = tr->data[cpu]; 60 data = tr->data[cpu];
58 disabled = atomic_inc_return(&data->disabled); 61 disabled = atomic_inc_return(&data->disabled);
59 62
60 if (likely(disabled == 1)) 63 if (likely(disabled == 1)) {
61 tracing_sched_wakeup_trace(tr, data, wakee, curr, flags); 64 tracing_sched_wakeup_trace(tr, data, wakee, curr, flags);
65 ftrace_all_fair_tasks(__rq, tr, data);
66 }
62 67
63 atomic_dec(&data->disabled); 68 atomic_dec(&data->disabled);
64 local_irq_restore(flags); 69 local_irq_restore(flags);
65} 70}
66 71
67void ftrace_ctx_switch(struct task_struct *prev, struct task_struct *next) 72void
73ftrace_ctx_switch(void *__rq, struct task_struct *prev,
74 struct task_struct *next)
68{ 75{
69 tracing_record_cmdline(prev); 76 tracing_record_cmdline(prev);
70 77
@@ -72,7 +79,7 @@ void ftrace_ctx_switch(struct task_struct *prev, struct task_struct *next)
72 * If tracer_switch_func only points to the local 79 * If tracer_switch_func only points to the local
73 * switch func, it still needs the ptr passed to it. 80 * switch func, it still needs the ptr passed to it.
74 */ 81 */
75 ctx_switch_func(prev, next); 82 ctx_switch_func(__rq, prev, next);
76 83
77 /* 84 /*
78 * Chain to the wakeup tracer (this is a NOP if disabled): 85 * Chain to the wakeup tracer (this is a NOP if disabled):
@@ -81,11 +88,12 @@ void ftrace_ctx_switch(struct task_struct *prev, struct task_struct *next)
81} 88}
82 89
83void 90void
84ftrace_wake_up_task(struct task_struct *wakee, struct task_struct *curr) 91ftrace_wake_up_task(void *__rq, struct task_struct *wakee,
92 struct task_struct *curr)
85{ 93{
86 tracing_record_cmdline(curr); 94 tracing_record_cmdline(curr);
87 95
88 wakeup_func(wakee, curr); 96 wakeup_func(__rq, wakee, curr);
89 97
90 /* 98 /*
91 * Chain to the wakeup tracer (this is a NOP if disabled): 99 * Chain to the wakeup tracer (this is a NOP if disabled):