[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A7BF5B3.6060202@cn.fujitsu.com>
Date: Fri, 07 Aug 2009 17:36:51 +0800
From: Zhaolei <zhaolei@...fujitsu.com>
To: Li Zefan <lizf@...fujitsu.com>
CC: Steven Rostedt <srostedt@...hat.com>, Ingo Molnar <mingo@...e.hu>,
Frederic Weisbecker <fweisbec@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: Re: [PATCH 2/2] ftrace: Unify effect of writing to trace_options
and option/*
Li Zefan wrote:
> Zhaolei wrote:
>> "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().
>>
>
> Nice catch.
>
>> Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com>
>> ---
>> kernel/trace/trace.c | 5 ++---
>> 1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
>> index 464b7bb..2fa2bac 100644
>> --- a/kernel/trace/trace.c
>> +++ b/kernel/trace/trace.c
>> @@ -3893,12 +3893,11 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
>>
>> switch (val) {
>> case 0:
>> - trace_flags &= ~(1 << index);
>> + set_tracer_flags(1 << index, 0);
>> break;
>> case 1:
>> - trace_flags |= 1 << index;
>> + set_tracer_flags(1 << index, 1);
>> break;
>> -
>> default:
>> return -EINVAL;
>> }
>
> The whole switch statement can be simplied:
>
> if (val != 0 || val != 1)
> return -EINVAL;
> set_tracer_flags(1 << index, val);
Hello, Li
Thanks.
V2 will send.
Thanks
Zhaolei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists