Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hang Zhengyang" <hang.zhengyang1010@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf parse-events: Don't report unreadable tracepoint globs as unknown
Date: Tue, 10 Nov 2026 03:11:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-206093@kernel.org> (raw)
In-Reply-To: <20261110-tp-glob-errno-v1-1-6c2cb609c590@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] perf parse-events: event enumeration abort in
  add_tracepoint_multi_sys_cb() [1]
--

commit a63217b652c98d06df0265b3b5da9302408c378e
Author: Hang Zhengyang <hang.zhengyang1010@gmail.com>

perf parse-events: Don't report unreadable tracepoint globs as unknown

This commit preserves the directory read error in add_tracepoint_multi_sys()
when no tracepoints match a glob, rather than always reporting -ENOENT.

> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index f3ba70d4f76b2..8a6d5a13863d2 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -572,8 +572,10 @@ static int add_tracepoint_multi_sys(struct parse_events_state *parse_state,
>  		ret = tp_pmu__for_each_tp_sys(&args, add_tracepoint_multi_sys_cb);
>  	}
>  	if (args.found == 0) {
> -		tracepoint_error(err, ENOENT, sys_glob, evt_glob, loc->first_column);
> -		return -ENOENT;
> +		if (!ret)
> +			ret = -ENOENT;
> +		tracepoint_error(err, ret, sys_glob, evt_glob, loc->first_column);
> +		return ret;
>  	}
>  	return ret;
>  }

[Severity: Medium]
This problem wasn't introduced by this patch, but can concurrent removal of a
tracepoint subsystem directory cause add_tracepoint_multi_sys_cb() to abort
the entire enumeration [1]?

While tp_pmu__for_each_tp_sys() iterates over subsystem directories,
add_tracepoint_multi_sys_cb() calls add_tracepoint_multi_event() ->
tp_pmu__for_each_tp_event(). If a matching subsystem directory is removed
before open(), tp_pmu__for_each_tp_event() returns -ENOENT, which stops the
loop in tp_pmu__for_each_tp_sys() instead of skipping the missing directory
and continuing to enumerate the remaining tracepoints.

[1] https://sashiko.dev/#/bug/linux-0b2ec2f2-377b-4c58-91d0-b8dd34e637ac

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110-tp-glob-errno-v1-1-6c2cb609c590@gmail.com?part=1

  reply	other threads:[~2026-11-10  3:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  3:04 [PATCH] perf parse-events: Don't report unreadable tracepoint globs as unknown Hang Zhengyang via B4 Relay
2026-11-10  3:11 ` sashiko-bot [this message]
2026-11-10 18:14 ` Ian Rogers

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=sashiko-outbox-206093@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=hang.zhengyang1010@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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