aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_sched_switch.c
diff options
context:
space:
mode:
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;