diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2025-04-24 16:47:14 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2025-04-25 15:55:19 +0300 |
commit | 75aea4b0656ead0facd13d2aae4cb77326e53d2f (patch) | |
tree | ccd0bbb8645cc272458c061621333d7760e95905 /drivers/usb/cdns3/cdns3-imx.c | |
parent | 1a97fea9db9e9b9c4839d4232dde9f505ff5b4cc (diff) | |
download | linux-75aea4b0656ead0facd13d2aae4cb77326e53d2f.tar.xz |
perf/x86/intel: Only check the group flag for X86 leader
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.
The patch only fixes the issue for the branch counter group.
The following patch will fix the other groups.
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.
Fixes: 33744916196b ("perf/x86/intel: Support branch counters logging")
Closes: https://lore.kernel.org/lkml/20250412091423.1839809-1-luogengkun@huaweicloud.com/
Reported-by: Luo Gengkun <luogengkun@huaweicloud.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20250424134718.311934-2-kan.liang@linux.intel.com
Diffstat (limited to 'drivers/usb/cdns3/cdns3-imx.c')
0 files changed, 0 insertions, 0 deletions