aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace_sched_switch.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 21:20:53 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 21:08:47 +0200
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 5a217e86358..bddf676914e 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,
wakeup_sched_wakeup(wakee, curr);
}
+void
+ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3)
+{
+ struct trace_array *tr = ctx_trace;
+ struct trace_array_cpu *data;
+ unsigned long flags;
+ long disabled;
+ int cpu;
+
+ if (!tracer_enabled)
+ return;
+
+ local_irq_save(flags);
+ cpu = raw_smp_processor_id();
+ data = tr->data[cpu];
+ disabled = atomic_inc_return(&data->disabled);
+
+ if (likely(disabled == 1))
+ __trace_special(tr, data, arg1, arg2, arg3);
+
+ atomic_dec(&data->disabled);
+ local_irq_restore(flags);
+}
+
static void sched_switch_reset(struct trace_array *tr)
{
int cpu;