linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@kernel.org>
To: Steven Rostedt <rostedt@kernel.org>,
	linux-kernel@vger.kernel.org,
	 linux-trace-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 3/3] tracing: Use strim() in trigger_process_regex() instead of skip_spaces()
Date: Wed, 03 Dec 2025 16:40:04 -0600	[thread overview]
Message-ID: <9393741d90fff46709a2c9b0b04f406d5245d000.camel@kernel.org> (raw)
In-Reply-To: <20251125214032.323747707@kernel.org>

On Tue, 2025-11-25 at 16:40 -0500, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> 
> 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.
> 
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

Looks good to me.

Reviewed-by: Tom Zanussi <zanussi@kernel.org>

> ---
>  kernel/trace/trace_events_trigger.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
> index 3b97c242b795..96aad82b1628 100644
> --- a/kernel/trace/trace_events_trigger.c
> +++ b/kernel/trace/trace_events_trigger.c
> @@ -308,7 +308,8 @@ int trigger_process_regex(struct trace_event_file *file, char *buff)
>  	char *command, *next;
>  	struct event_command *p;
>  
> -	next = buff = skip_spaces(buff);
> +	next = buff = strim(buff);
> +
>  	command = strsep(&next, ": \t");
>  	if (next) {
>  		next = skip_spaces(next);
> @@ -345,8 +346,6 @@ static ssize_t event_trigger_regex_write(struct file *file,
>  	if (IS_ERR(buf))
>  		return PTR_ERR(buf);
>  
> -	strim(buf);
> -
>  	guard(mutex)(&event_mutex);
>  
>  	event_file = event_file_file(file);


  reply	other threads:[~2025-12-03 22:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 21:40 [PATCH v2 0/3] tracing: More clean ups of triggers Steven Rostedt
2025-11-25 21:40 ` [PATCH v2 1/3] tracing: Remove unneeded event_mutex lock in event_trigger_regex_release() Steven Rostedt
2025-12-03 22:38   ` Tom Zanussi
2025-11-25 21:40 ` [PATCH v2 2/3] tracing: Add bulk garbage collection of freeing event_trigger_data Steven Rostedt
2025-12-03 22:39   ` Tom Zanussi
2025-11-25 21:40 ` [PATCH v2 3/3] tracing: Use strim() in trigger_process_regex() instead of skip_spaces() Steven Rostedt
2025-12-03 22:40   ` Tom Zanussi [this message]
2025-12-03 22:46     ` Steven Rostedt
2025-12-03 22:58       ` Tom Zanussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9393741d90fff46709a2c9b0b04f406d5245d000.camel@kernel.org \
    --to=zanussi@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).