Re: [PATCH] tracing: Add a way to filter function addresses to function names

From: Zheng Yejian
Date: Mon Dec 19 2022 - 20:47:12 EST



On 2022/12/20 02:21, Steven Rostedt wrote:
On Mon, 19 Dec 2022 10:38:50 +0800
Zheng Yejian <zhengyejian1@xxxxxxxxxx> 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