diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-05-12 15:20:53 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 15:08:47 -0400 |
commit | 88a4216c3ec4281fc7e6725cc3a3ccd01fb1aa14 (patch) | |
tree | 3d93bdfa757da02953ec2532f7504a2e7f81ea78 /kernel/trace | |
parent | 36fc25a9f48deacd8aa08cd2d1c186a4e412604f (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')
-rw-r--r-- | kernel/trace/trace.c | 6 | ||||
-rw-r--r-- | kernel/trace/trace_sched_switch.c | 24 |
2 files changed, 27 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 3a4032492fcb..b87a26414892 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1251,7 +1251,7 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) | |||
1251 | comm); | 1251 | comm); |
1252 | break; | 1252 | break; |
1253 | case TRACE_SPECIAL: | 1253 | case TRACE_SPECIAL: |
1254 | trace_seq_printf(s, " %ld %ld %ld\n", | 1254 | trace_seq_printf(s, "# %ld %ld %ld\n", |
1255 | entry->special.arg1, | 1255 | entry->special.arg1, |
1256 | entry->special.arg2, | 1256 | entry->special.arg2, |
1257 | entry->special.arg3); | 1257 | entry->special.arg3); |
@@ -1335,7 +1335,7 @@ static int print_trace_fmt(struct trace_iterator *iter) | |||
1335 | return 0; | 1335 | return 0; |
1336 | break; | 1336 | break; |
1337 | case TRACE_SPECIAL: | 1337 | case TRACE_SPECIAL: |
1338 | ret = trace_seq_printf(s, " %ld %ld %ld\n", | 1338 | ret = trace_seq_printf(s, "# %ld %ld %ld\n", |
1339 | entry->special.arg1, | 1339 | entry->special.arg1, |
1340 | entry->special.arg2, | 1340 | entry->special.arg2, |
1341 | entry->special.arg3); | 1341 | entry->special.arg3); |
@@ -1400,7 +1400,7 @@ static int print_raw_fmt(struct trace_iterator *iter) | |||
1400 | break; | 1400 | break; |
1401 | case TRACE_SPECIAL: | 1401 | case TRACE_SPECIAL: |
1402 | case TRACE_STACK: | 1402 | case TRACE_STACK: |
1403 | ret = trace_seq_printf(s, " %ld %ld %ld\n", | 1403 | ret = trace_seq_printf(s, "# %ld %ld %ld\n", |
1404 | entry->special.arg1, | 1404 | entry->special.arg1, |
1405 | entry->special.arg2, | 1405 | entry->special.arg2, |
1406 | entry->special.arg3); | 1406 | entry->special.arg3); |
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 | ||
106 | void | ||
107 | ftrace_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 | |||
106 | static void sched_switch_reset(struct trace_array *tr) | 130 | static void sched_switch_reset(struct trace_array *tr) |
107 | { | 131 | { |
108 | int cpu; | 132 | int cpu; |