aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_sched_switch.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 15:20:53 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 15:08:47 -0400
commit88a4216c3ec4281fc7e6725cc3a3ccd01fb1aa14 (patch)
tree3d93bdfa757da02953ec2532f7504a2e7f81ea78 /kernel/trace/trace_sched_switch.c
parent36fc25a9f48deacd8aa08cd2d1c186a4e412604f (diff)
ftrace: sched special
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, 24 insertions, 0 deletions
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
index 5a217e863586..bddf676914ed 100644
--- a/kernel/trace/trace_sched_switch.c
+++ b/kernel/trace/trace_sched_switch.c
@@ -103,6 +103,30 @@ ftrace_wake_up_task(void *__rq, struct task_struct *wakee,
103 wakeup_sched_wakeup(wakee, curr); 103 wakeup_sched_wakeup(wakee, curr);
104} 104}
105 105
106void
107ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
108{
109 struct trace_array *tr = ctx_trace;
110 struct trace_array_cpu *data;
111 unsigned long flags;
112 long disabled;
113 int cpu;
114
115 if (!tracer_enabled)
116 return;
117
118 local_irq_save(flags);
119 cpu = raw_smp_processor_id();
120 data = tr->data[cpu];
121 disabled = atomic_inc_return(&data->disabled);
122
123 if (likely(disabled == 1))
124 __trace_special(tr, data, arg1, arg2, arg3);
125
126 atomic_dec(&data->disabled);
127 local_irq_restore(flags);
128}
129
106static void sched_switch_reset(struct trace_array *tr) 130static void sched_switch_reset(struct trace_array *tr)
107{ 131{
108 int cpu; 132 int cpu;