mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Tom Zanussi <zanussi@kernel.org>,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: Don't log an error for the speculative field variable lookup
Date: Thu, 15 Oct 2026 18:38:41 -0400	[thread overview]
Message-ID: <20261015183841.4cbc5af2@gandalf.local.home> (raw)
In-Reply-To: <20260913203156.941433-1-donggeunyoo.kernel@gmail.com>

On Mon, 14 Sep 2026 05:31:56 +0900
Donggeun Yoo <donggeunyoo.kernel@gmail.com> wrote:

> diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> index 963e0d6b61fd..4676dc6d9146 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -806,9 +806,12 @@ static void last_cmd_set(struct trace_event_file *file, char *str)
>  		snprintf(last_cmd_loc, MAX_FILTER_STR_VAL, HIST_PREFIX "%s:%s", system, name);
>  }
>  
> +/* Set while a field lookup may fail silently; the parse path is serialized. */
> +static bool hist_err_silent;
> +
>  static void hist_err(struct trace_array *tr, u8 err_type, u16 err_pos)
>  {
> -	if (!last_cmd)
> +	if (!last_cmd || hist_err_silent)
>  		return;
>  
>  	tracing_log_err(tr, last_cmd_loc, last_cmd, err_text,
> @@ -4003,7 +4006,9 @@ trace_action_create_field_var(struct hist_trigger_data *hist_data,
>  	 * unqualified fields on the target event, or if qualified,
>  	 * target fields that have qualified names matching the target.
>  	 */
> +	hist_err_silent = true;
>  	field_var = create_target_field_var(hist_data, system, event, var);
> +	hist_err_silent = false;
>  
>  	if (field_var && !IS_ERR(field_var)) {
>  		save_field_var(hist_data, field_var);

I applied this patch then I unapplied it after looking at it.

This looks racy as hist_err_silent is global. The parse path is serialized
but we should add a lockdep assert in hist_err() to make sure the event
mutex is held, as well as by the setting of the hist_err_silent to prove
that the code is serialized.

-- Steve

      parent reply	other threads:[~2026-10-15 22:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 20:31 Donggeun Yoo
     [not found] ` <20260913204554.91A9F1F000FF@smtp.kernel.org>
2026-09-14  3:45   ` Donggeun Yoo
2026-10-15 22:38 ` Steven Rostedt [this message]

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=20261015183841.4cbc5af2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=donggeunyoo.kernel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=zanussi@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

all inboxes | Powered by JetHome®