diff options
| author | Ian Rogers <irogers@google.com> | 2025-10-17 16:03:57 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-10-20 13:05:37 +0900 |
| commit | 800201997a509c298e74696da3586d82b1a2b6f4 (patch) | |
| tree | ac3e54fad773586d8e673ab989dc2e5d5b59a1aa /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | ad83f3b7155db28e82de24dbaa1af2b8f5d972a3 (diff) | |
| download | linux-800201997a509c298e74696da3586d82b1a2b6f4.tar.gz linux-800201997a509c298e74696da3586d82b1a2b6f4.zip | |
perf parse-events: Make X modifier more respectful of groups
Events with an X modifier were reordered within a group, for example
slots was made the leader in:
```
$ perf record -e '{cpu/mem-stores/ppu,cpu/slots/uX}' -- sleep 1
```
Fix by making `dont_regroup` evsels always use their index for
sorting. Make the cur_leader, when fixing the groups, be that of
`dont_regroup` evsel so that the `dont_regroup` evsel doesn't become a
leader.
On a tigerlake this patch corrects this and meets expectations in:
```
$ perf stat -e '{cpu/mem-stores/,cpu/slots/uX}' -a -- sleep 0.1
Performance counter stats for 'system wide':
83,458,652 cpu/mem-stores/
2,720,854,880 cpu/slots/uX
0.103780587 seconds time elapsed
$ perf stat -e 'slots,slots:X' -a -- sleep 0.1
Performance counter stats for 'system wide':
732,042,247 slots (48.96%)
643,288,155 slots:X (51.04%)
0.102731018 seconds time elapsed
```
Closes: https://lore.kernel.org/lkml/18f20d38-070c-4e17-bc90-cf7102e1e53d@linux.intel.com/
Fixes: 035c17893082 ("perf parse-events: Add 'X' modifier to exclude an event from being regrouped")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions
