Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Use strim() in trigger_process_regex() instead of skip_spaces()

The function trigger_process_regex() is called by a few functions, where
only one calls strim() on the buffer passed to it. That leaves the other
functions not trimming the end of the buffer passed in and making it a
little inconsistent.

Remove the strim() from event_trigger_regex_write() and have
trigger_process_regex() use strim() instead of skip_spaces(). The buff
variable is not passed in as const, so it can be modified.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20251125214032.323747707@kernel.org
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+2 -3
+2 -3
kernel/trace/trace_events_trigger.c
··· 308 308 char *command, *next; 309 309 struct event_command *p; 310 310 311 - next = buff = skip_spaces(buff); 311 + next = buff = strim(buff); 312 + 312 313 command = strsep(&next, ": \t"); 313 314 if (next) { 314 315 next = skip_spaces(next); ··· 345 344 buf = memdup_user_nul(ubuf, cnt); 346 345 if (IS_ERR(buf)) 347 346 return PTR_ERR(buf); 348 - 349 - strim(buf); 350 347 351 348 guard(mutex)(&event_mutex); 352 349