All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: Jackie Liu <liu.yun@linux.dev>
Cc: rostedt@goodmis.org, mhiramat@kernel.org,
	mathieu.desnoyers@efficios.com,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: Propagate errors from remote event bulk updates
Date: Wed, 15 Jul 2026 07:44:04 +0100	[thread overview]
Message-ID: <alcsNLVLhWOH3KbJ@google.com> (raw)
In-Reply-To: <20260715060448.17674-1-liu.yun@linux.dev>

On Wed, Jul 15, 2026 at 02:04:48PM +0800, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> remote_events_dir_enable_write() ignores the return value from
> trace_remote_enable_event(). If a remote rejects an event state change,
> the write therefore reports success even though the affected event remains
> in its previous state.
> 
> Keep trying all events, but retain and return the first error. This matches
> __ftrace_set_clr_event_nolock(), which permits partial updates while
> notifying userspace when an operation fails.
> 
> Fixes: 775cb093bc50 ("tracing: Add events/ root files to trace remotes")
> Assisted-by: Codex:gpt-5.6-sol
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>

I have sent a related improvement for that here [1]

[1] https://lore.kernel.org/all/20260605163825.1762953-3-vdonnefort@google.com/


> ---
>  kernel/trace/trace_remote.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c
> index 0f6ef5c36d84..5212e685f0a3 100644
> --- a/kernel/trace/trace_remote.c
> +++ b/kernel/trace/trace_remote.c
> @@ -1149,11 +1149,22 @@ static ssize_t remote_events_dir_enable_write(struct file *filp, const char __us
>  	guard(mutex)(&remote->lock);
>  
>  	for (i = 0; i < remote->nr_events; i++) {
> +		int eret;
>  		struct remote_event *evt = &remote->events[i];
>  
> -		trace_remote_enable_event(remote, evt, enable);
> +		eret = trace_remote_enable_event(remote, evt, enable);
> +		/*
> +		 * Save the first error and return that. Some events
> +		 * may still have been enabled, but let the user
> +		 * know that something went wrong.
> +		 */
> +		if (!ret && eret)
> +			ret = eret;
>  	}
>  
> +	if (ret)
> +		return ret;
> +
>  	return count;
>  }
>  
> -- 
> 2.54.0
> 
> 

  reply	other threads:[~2026-07-15  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15  6:04 [PATCH] tracing: Propagate errors from remote event bulk updates Jackie Liu
2026-07-15  6:44 ` Vincent Donnefort [this message]
2026-07-15  7:02   ` Jackie Liu
2026-07-15  7:25     ` Vincent Donnefort

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=alcsNLVLhWOH3KbJ@google.com \
    --to=vdonnefort@google.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=liu.yun@linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.