[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ed4ea9ae-78bf-b323-9380-47b1fd58c72b@huawei.com>
Date: Tue, 20 Dec 2022 09:40:05 +0800
From: Zheng Yejian <zhengyejian1@...wei.com>
To: Steven Rostedt <rostedt@...dmis.org>
CC: LKML <linux-kernel@...r.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@...r.kernel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Ross Zwisler <zwisler@...gle.com>,
Tom Zanussi <zanussi@...nel.org>
Subject: Re: [PATCH] tracing: Add a way to filter function addresses to
function names
On 2022/12/20 02:21, Steven Rostedt wrote:
> On Mon, 19 Dec 2022 10:38:50 +0800
> Zheng Yejian <zhengyejian1@...wei.com> wrote:
>
>>> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
>>> index 33e0b4f8ebe6..db6e2f399440 100644
>>> --- a/kernel/trace/trace_events.c
>>> +++ b/kernel/trace/trace_events.c
>>> @@ -2822,7 +2822,7 @@ static __init int setup_trace_triggers(char *str)
>>> if (!trigger)
>>> break;
>>> bootup_triggers[i].event = strsep(&trigger, ".");
>>> - bootup_triggers[i].trigger = strsep(&trigger, ".");
>>> + bootup_triggers[i].trigger = strsep(&trigger, "");
>>
>> Would it be better to change to:
>>
>> bootup_triggers[i].trigger = trigger;
>>
>
> Sure, I'll make the update.
>
>> Because there is unnecessary loop if call strsep(s, "") :-)
>> strsep(s, ct) {
>> strpbrk(cs, ct) {
>> // when 'ct' is empty string, here will always return NULL
>> // after traversing string 'cs'
>
> I'm not sure what you mean about an extra loop.
I just mean above "traversing string 'cs'" in strpbrk(s, "") is
unnecessary. Sorry for making the ambiguity :-(
>
> Thanks,
>
> -- Steve
>
Powered by blists - more mailing lists