Re: [PATCH 2/2] perf trace: Guard __probe_ip suppression with evsel__is_probe()
From: Aaron Tomlin
Date: Tue Jun 16 2026 - 07:46:26 EST
On Mon, Jun 15, 2026 at 10:31:57PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> trace__fprintf_tp_fields() compares every field name against
> "__probe_ip" for all tracepoint events, but this field is only
> implicitly added by the Ftrace subsystem to bare dynamic probes.
>
> Add an evsel__is_probe() check before the strcmp so the string
> comparison is skipped entirely for non-probe events.
>
> Cc: Aaron Tomlin <atomlin@xxxxxxxxxxx>
> Assisted-by: Claude <noreply@xxxxxxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> ---
> tools/perf/builtin-trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index a8492da23a9cc178..57f3f14c5d435805 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -3267,7 +3267,7 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct perf_sample *
> * If verbose mode is enabled, ensure it is formatted as a
> * hexadecimal memory address rather than a signed integer.
> */
> - if (!strcmp(field->name, "__probe_ip")) {
> + if (evsel__is_probe(evsel) && !strcmp(field->name, "__probe_ip")) {
> if (!verbose)
> continue;
>
> --
> 2.54.0
>
LGTM.
Reviewed-by: Aaron Tomlin <atomlin@xxxxxxxxxxx>
--
Aaron Tomlin