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.
Thanks,
-- Steve