Linux Trace Kernel
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v7 06/10] tracing/probes: Type casting always involves nested calls
Date: Tue, 23 Jun 2026 20:50:11 +0900	[thread overview]
Message-ID: <20260623205011.6f295bbf425412435f25b72f@kernel.org> (raw)
In-Reply-To: <178217910709.643090.6379198143797177881.stgit@devnote2>


Sashiko commented:

> > +	}
> > +	*close = '\0';
> >  
> > -		ctx->offset += 1;	/* for the '(' */
> > -		/* We need to parse the nested one */
> > -		ret = parse_probe_arg(tmp + 1, find_fetch_type(NULL, ctx->flags),
> > -				pcode, end, ctx);
> > -		if (ret < 0)
> > -			return ret;
> > -		ctx->nested_level--;
> > -		clear_struct_btf(ctx);
> > +	/* We need to parse the nested one */
> > +	ret = parse_probe_arg(tmp, find_fetch_type(NULL, ctx->flags),
> > +			      pcode, end, ctx);
> 
> Does routing the nested argument through parse_probe_arg() instead of 
> parse_btf_arg() break the documented eprobe syntax (STRUCT)FIELD->MEMBER?
> Since this patch removes the TPARG_FL_TEVENT handling block from
> parse_btf_arg(), and handle_typecast() now recursively invokes 
> parse_probe_arg() on the extracted FIELD name, a bare eprobe FIELD name 
> that does not start with a '$' prefix will hit the default case in 
> parse_probe_arg().
> This causes it to be unconditionally rejected with -EINVAL (NOSUP_BTFARG) 
> because eprobe flags (TPARG_FL_TEVENT) do not satisfy 
> tparg_is_function_entry() or tparg_is_function_return(). This acts as an 
> ABI breakage for existing user-space scripts relying on this eprobe syntax.

Wait... Did the type-casting support patch accidentally allow access to
event fields without the "$"?

Hmm, if so, it should be documented, and need to support correctly
with/without typecast.

Thank you,

-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  reply	other threads:[~2026-06-23 11:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  1:44 [PATCH v7 00/10] tracing/probes: Add more typecast features Masami Hiramatsu (Google)
2026-06-23  1:44 ` [PATCH v7 01/10] tracing/probes: Fix double addition of offset for @+FOFFSET Masami Hiramatsu (Google)
2026-06-23  1:44 ` [PATCH v7 02/10] tracing/probes: Rename FETCH_OP_DATA to FETCH_OP_IMMSTR Masami Hiramatsu (Google)
2026-06-23  1:44 ` [PATCH v7 03/10] tracing/probes: Support dumping fetcharg program for debugging dynamic events Masami Hiramatsu (Google)
2026-06-23  1:44 ` [PATCH v7 04/10] tracing/probes: Support typecast for various probe events Masami Hiramatsu (Google)
2026-06-23  1:44 ` [PATCH v7 05/10] tracing/probes: Support nested typecast Masami Hiramatsu (Google)
2026-06-23  1:45 ` [PATCH v7 06/10] tracing/probes: Type casting always involves nested calls Masami Hiramatsu (Google)
2026-06-23 11:50   ` Masami Hiramatsu [this message]
2026-06-23  1:45 ` [PATCH v7 07/10] tracing/probes: Support field specifier option for typecast Masami Hiramatsu (Google)
2026-06-23  1:45 ` [PATCH v7 08/10] tracing/probes: Add $current variable support Masami Hiramatsu (Google)
2026-06-23  1:45 ` [PATCH v7 09/10] tracing/probes: Add this_cpu_read() and this_cpu_ptr() dereference method to fetcharg Masami Hiramatsu (Google)
2026-06-23  1:45 ` [PATCH v7 10/10] tracing/probes: Add a new testcase for BTF typecasts Masami Hiramatsu (Google)
2026-06-23 13:54 ` [PATCH v7 00/10] tracing/probes: Add more typecast features Masami Hiramatsu

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=20260623205011.6f295bbf425412435f25b72f@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.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