From: Peter Zijlstra <peterz@infradead.org>
To: kan.liang@linux.intel.com
Cc: mingo@redhat.com, acme@kernel.org, namhyung@kernel.org,
irogers@google.com, linux-kernel@vger.kernel.org,
Luo Gengkun <luogengkun@huaweicloud.com>
Subject: Re: [PATCH 1/2] perf/x86/intel: Only check the group flag for X86 leader
Date: Thu, 24 Apr 2025 11:40:50 +0200 [thread overview]
Message-ID: <20250424094050.GE19534@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250423221015.268949-1-kan.liang@linux.intel.com>
On Wed, Apr 23, 2025 at 03:10:14PM -0700, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> A warning in intel_pmu_lbr_counters_reorder() may be triggered by below
> perf command.
>
> perf record -e "{cpu-clock,cycles/call-graph="lbr"/}" -- sleep 1
>
> It's because the group is mistakenly treated as a branch counter group.
>
> The hw.flags of the leader are used to determine whether a group is a
> branch counters group. However, the hw.flags is only available for a
> hardware event. The field to store the flags is a union type. For a
> software event, it's a hrtimer. The corresponding bit may be set if the
> leader is a software event.
>
> For a branch counter group and other groups that have a group flag
> (e.g., topdown, PEBS counters snapshotting, and ACR), the leader must
> be a X86 event. Check the X86 event before checking the flag.
>
> There may be an alternative way to fix the issue by moving the hw.flags
> out of the union type. It should work for now. But it's still possible
> that the flags will be used by other types of events later. As long as
> that type of event is used as a leader, a similar issue will be
> triggered. So the alternative way is dropped.
>
> Reported-by: Luo Gengkun <luogengkun@huaweicloud.com>
> Closes: https://lore.kernel.org/lkml/20250412091423.1839809-1-luogengkun@huaweicloud.com/
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Can I get a Fixes tag for this such that I can stick it in urgent?
next prev parent reply other threads:[~2025-04-24 9:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 22:10 kan.liang
2025-04-23 22:10 ` [PATCH 2/2] perf/x86: Optimize the is_x86_event kan.liang
2025-04-24 9:40 ` Peter Zijlstra [this message]
2025-04-24 13:50 ` [PATCH 1/2] perf/x86/intel: Only check the group flag for X86 leader Liang, Kan
2025-04-24 13:57 ` Peter Zijlstra
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=20250424094050.GE19534@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=irogers@google.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luogengkun@huaweicloud.com \
--cc=mingo@redhat.com \
--cc=namhyung@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®