From: Zhaolei <zhaolei@cn.fujitsu.com>
To: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/2] ftrace: Add check of sched_stopped for probe_sched_wakeup
Date: Tue, 31 Mar 2009 15:24:51 +0800 [thread overview]
Message-ID: <49D1C543.3010307@cn.fujitsu.com> (raw)
In-Reply-To: <49D1C51C.7000407@cn.fujitsu.com>
We need check sched_stopped in probe_sched_wakeup() to stop tracing when an
user stops it.
But current code can also do the right thing(stop tracing after
echo 0 > tracing_enabled) just because tracing_sched_wakeup_trace() can return
on buffer->record_disabled.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
kernel/trace/trace_sched_switch.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
index de35f20..9117cea 100644
--- a/kernel/trace/trace_sched_switch.c
+++ b/kernel/trace/trace_sched_switch.c
@@ -62,6 +62,9 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee, int success)
pc = preempt_count();
tracing_record_cmdline(current);
+ if (sched_stopped)
+ return;
+
local_irq_save(flags);
cpu = raw_smp_processor_id();
data = ctx_trace->data[cpu];
--
1.5.5.3
next prev parent reply other threads:[~2009-03-31 7:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-31 7:24 [PATCH v2 0/2] ftrace: Add check of sched_stopped for probe_sched_wakeup Zhaolei
2009-03-31 7:24 ` Zhaolei [this message]
2009-04-03 19:50 ` [PATCH v2 1/2] " Steven Rostedt
2009-04-07 13:13 ` [tip:tracing/urgent] " Zhaolei
2009-03-31 7:26 ` [PATCH v2 2/2] ftrace: Clean up enable logic for sched_switch Zhaolei
2009-04-03 20:14 ` Steven Rostedt
2009-04-08 6:55 ` [tip:tracing/core] ftrace: clean " Zhaolei
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=49D1C543.3010307@cn.fujitsu.com \
--to=zhaolei@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.