[RFC][PATCH 2/2] [PATCH 2/2] tracing: Only trace sched_wakeup if it actually work something up

From: Steven Rostedt
Date: Thu Dec 02 2010 - 17:48:23 EST


From: Steven Rostedt <srostedt@xxxxxxxxxx>

Currently the tracepoint sched_wakeup traces the wakeup event even
if the wakeup failed to wake anything up. This is quite stupid
but it happens because we did not want to add a conditional
to the core kernel code that would just slow down the wakeup events.

This patch changes the wakeup tracepoints to use the

DECLARE_EVENT_CLASS_CONDITIONAL()

to test the "success" parameter and will only trace the event if
the wakeup was successfull.

The success field in the tracepoint is removed since it is no
longer needed.

Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
include/trace/events/sched.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 67456f0..0807a25 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -52,17 +52,18 @@ TRACE_EVENT(sched_kthread_stop_ret,
/*
* Tracepoint for waking up a task:
*/
-DECLARE_EVENT_CLASS(sched_wakeup_template,
+DECLARE_EVENT_CLASS_CONDITION(sched_wakeup_template,

TP_PROTO(struct task_struct *p, int success),

TP_ARGS(p, success),

+ TP_CONDITION(success),
+
TP_STRUCT__entry(
__array( char, comm, TASK_COMM_LEN )
__field( pid_t, pid )
__field( int, prio )
- __field( int, success )
__field( int, target_cpu )
),

@@ -70,13 +71,12 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->prio = p->prio;
- __entry->success = success;
__entry->target_cpu = task_cpu(p);
),

- TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d",
+ TP_printk("comm=%s pid=%d prio=%d target_cpu=%03d",
__entry->comm, __entry->pid, __entry->prio,
- __entry->success, __entry->target_cpu)
+ __entry->target_cpu)
);

DEFINE_EVENT(sched_wakeup_template, sched_wakeup,
--
1.7.2.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/