From: Zhaolei <zhaolei@cn.fujitsu.com>
To: Li Zefan <lizf@cn.fujitsu.com>,
Steven Rostedt <srostedt@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 2/2] ftrace: Unify effect of writing to trace_options and option/*
Date: Fri, 07 Aug 2009 18:55:48 +0800 [thread overview]
Message-ID: <4A7C0834.20303@cn.fujitsu.com> (raw)
In-Reply-To: <4A7A6470.60305@cn.fujitsu.com>
"echo noglobal-clock > trace_options" can be used to change trace
clock but "echo 0 > options/global-clock" can't.
We can fix it by using set_tracer_flags() in trace_options_core_write().
Changelog:
v1->v2: Simplied switch() by Li Zefan <lizf@cn.fujitsu.com>'s suggest.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
kernel/trace/trace.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 6c5f67f..06a2dfa 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3718,17 +3718,9 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
if (ret < 0)
return ret;
- switch (val) {
- case 0:
- trace_flags &= ~(1 << index);
- break;
- case 1:
- trace_flags |= 1 << index;
- break;
-
- default:
+ if (val != 0 && val != 1)
return -EINVAL;
- }
+ set_tracer_flags(1 << index, val);
*ppos += cnt;
--
1.5.5.3
next prev parent reply other threads:[~2009-08-07 10:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 3:26 [PATCH 1/2] ftrace: Rename set_tracer_flags()'s local variable trace_flags Zhaolei
2009-08-06 3:27 ` [PATCH 2/2] ftrace: Unify effect of writing to trace_options and option/* Zhaolei
2009-08-06 4:53 ` Frederic Weisbecker
2009-08-06 5:04 ` Li Zefan
2009-08-07 9:36 ` Zhaolei
2009-08-07 10:53 ` [PATCH v2 1/2] ftrace: Rename set_tracer_flags()'s local variable trace_flags Zhaolei
2009-08-08 0:38 ` Frederic Weisbecker
2009-08-07 10:55 ` Zhaolei [this message]
2009-08-08 0:39 ` [PATCH v2 2/2] ftrace: Unify effect of writing to trace_options and option/* Frederic Weisbecker
2009-08-06 3:50 ` [PATCH 1/2] ftrace: Rename set_tracer_flags()'s local variable trace_flags 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=4A7C0834.20303@cn.fujitsu.com \
--to=zhaolei@cn.fujitsu.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=srostedt@redhat.com \
/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