Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "TAKANO Mitsuhiro" <takano32@gmail.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v10] perf stat: Refuse a group mixing tool and kernel events
Date: Tue, 01 Dec 2026 14:27:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-243478@kernel.org> (raw)
In-Reply-To: <20261201140836.2320511-1-takano32@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] perf stat: inaccurate parser split claim for hwmon/drm in
  perf-stat.txt
--

commit bb09784fff8e91b3f49cdb60c1ebfe292a8ef185
Author: TAKANO Mitsuhiro <takano32@gmail.com>

perf stat: Refuse a group mixing tool and kernel events

This commit refuses event groups that mix kernel events with events not
opened via perf_event_open() (such as tool, hwmon, and drm events), splits
weak groups led by such events, and skips members without descriptors when
enabling or disabling groups.

Link: https://lore.kernel.org/all/sashiko-outbox-227849@kernel.org/
Link: https://lore.kernel.org/all/sashiko-outbox-231330@kernel.org/
Link: https://lore.kernel.org/all/sashiko-outbox-232396@kernel.org/
Link: https://lore.kernel.org/all/20261111-tool-pmu-leader-v2-1-3faa0fb98c51@gmail.com/
Link: https://lore.kernel.org/all/awC_aZXD5FBGu4mO@google.com/
Link: https://lore.kernel.org/all/awTXdgY38s2bijW5@google.com/
Link: https://lore.kernel.org/all/20261123071913.653315-7-irogers@google.com/

> diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
> index 8ea17da89976d..02de7a91d8464 100644
> --- a/tools/perf/Documentation/perf-stat.txt
> +++ b/tools/perf/Documentation/perf-stat.txt
> @@ -65,6 +65,25 @@ report::
>  	Multiple PMU instances are typical for uncore PMUs, so the prefix
>  	'uncore_' is also ignored when performing this match.
>  
> +	Tool events such as duration_time and user_time are read by perf
> +	itself and have no event in the kernel; an hwmon event reads a
> +	sysfs file and a drm event reads /proc/<pid>/fdinfo.  None of
> +	them is opened with perf_event_open.  A group of such an event
> +	and an event from a different software PMU, such as cpu-clock,
> +	is split by the parser, which warns that events were regrouped;

[Severity: Low]
As reported by Ian Rogers on v9 [1], is this sentence accurate for hwmon
and drm events?  Unlike the tool PMU, perf_pmu__is_software() returns
false for hwmon and drm, so in a group like '{cpu-clock,hwmon_x}' the
software event adopts the hwmon or drm PMU name in
evsel__compute_group_pmu_name() rather than being split by the parser, and
check_unopened_in_group() refuses the group instead.  Saying "A group of a
tool event and an event from a different software PMU..." would match the
actual behavior and the updated commit message.

[1] https://lore.kernel.org/r/CAP-5=fVhXzO7TrPmzirS1dojWBupGfeGJOGiG9uytA3HjB+qww@mail.gmail.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201140836.2320511-1-takano32@gmail.com?part=1

      reply	other threads:[~2026-12-01 14:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  6:04 [PATCH v2] perf stat: Count kernel events in a group led by a tool event Hang Zhengyang via B4 Relay
2026-11-11  6:18 ` sashiko-bot
2026-11-11 11:06 ` [PATCH v3] " TAKANO Mitsuhiro
2026-11-11 11:33   ` sashiko-bot
2026-11-12  3:49     ` Hang Zhengyang
2026-11-19  8:06   ` Namhyung Kim
2026-11-19 10:08     ` TAKANO Mitsuhiro
2026-11-20 21:45       ` Namhyung Kim
2026-11-22  8:59   ` [PATCH v4] perf stat: Refuse a group mixing tool and kernel events TAKANO Mitsuhiro
2026-11-22  9:22     ` sashiko-bot
2026-11-24 13:56     ` [PATCH v5] " TAKANO Mitsuhiro
2026-11-24 14:18       ` sashiko-bot
2026-11-25  1:38       ` [PATCH v6] " TAKANO Mitsuhiro
2026-11-25  2:17         ` sashiko-bot
2026-11-25 13:38         ` [PATCH v7] " TAKANO Mitsuhiro
2026-11-25 13:56           ` sashiko-bot
2026-11-25 17:54           ` [PATCH v8] " TAKANO Mitsuhiro
2026-11-25 18:22             ` sashiko-bot
2026-11-25 22:27             ` [PATCH v9] " TAKANO Mitsuhiro
2026-11-25 22:59               ` sashiko-bot
2026-12-01  6:48               ` Ian Rogers
2026-12-01 14:08               ` [PATCH v10] " TAKANO Mitsuhiro
2026-12-01 14:27                 ` sashiko-bot [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=sashiko-outbox-243478@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=takano32@gmail.com \
    /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