From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Theodore Tso <tytso@mit.edu>,
Arjan van de Ven <arjan@infradead.org>,
Mathieu Desnoyers <compudj@krystal.dyndns.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [RFC][PATCH 2/2 v2] tracing: Only trace sched_wakeup if it actually work something up
Date: Thu, 02 Dec 2010 23:04:00 -0500 [thread overview]
Message-ID: <20101203040822.473086528@goodmis.org> (raw)
In-Reply-To: 20101203040358.955427199@goodmis.org
[-- Attachment #1: 0002-tracing-Only-trace-sched_wakeup-if-it-actually-work-.patch --]
[-- Type: text/plain, Size: 2327 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
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
DEFINE_EVENT_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@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
include/trace/events/sched.h | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index f633478..29e6030 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -62,7 +62,6 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
__array( char, comm, TASK_COMM_LEN )
__field( pid_t, pid )
__field( int, prio )
- __field( int, success )
__field( int, target_cpu )
),
@@ -70,25 +69,26 @@ 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,
+DEFINE_EVENT_CONDITION(sched_wakeup_template, sched_wakeup,
TP_PROTO(struct task_struct *p, int success),
- TP_ARGS(p, success));
+ TP_ARGS(p, success),
+ TP_CONDITION(success));
/*
* Tracepoint for waking up a new task:
*/
-DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
+DEFINE_EVENT_CONDITION(sched_wakeup_template, sched_wakeup_new,
TP_PROTO(struct task_struct *p, int success),
- TP_ARGS(p, success));
+ TP_ARGS(p, success),
+ TP_CONDITION(success));
#ifdef CREATE_TRACE_POINTS
static inline long __trace_sched_switch_state(struct task_struct *p)
--
1.7.2.3
next prev parent reply other threads:[~2010-12-03 4:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 4:03 [RFC][PATCH 0/2 v2] tracing: Add conditional to tracepoints Steven Rostedt
2010-12-03 4:03 ` [RFC][PATCH 1/2 v2] tracing: Add TRACE_EVENT_CONDITIONAL() Steven Rostedt
2010-12-03 4:54 ` Mathieu Desnoyers
2010-12-03 14:09 ` Steven Rostedt
2010-12-03 15:27 ` Mathieu Desnoyers
2010-12-03 15:38 ` Steven Rostedt
2010-12-03 15:46 ` Mathieu Desnoyers
2010-12-03 4:04 ` Steven Rostedt [this message]
2010-12-08 12:12 ` [RFC][PATCH 2/2 v2] tracing: Only trace sched_wakeup if it actually work something up Peter Zijlstra
2010-12-08 14:06 ` Steven Rostedt
2010-12-08 14:16 ` Peter Zijlstra
2010-12-03 14:47 ` [RFC][PATCH 0/2 v2] tracing: Add conditional to tracepoints Frederic Weisbecker
2010-12-03 14:53 ` Steven Rostedt
2010-12-03 14:59 ` Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101203040822.473086528@goodmis.org \
--to=rostedt@goodmis.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=compudj@krystal.dyndns.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox