Commit 8002019
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: 035c178 ("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>1 parent ad83f3b commit 8002019
1 file changed
+10
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1973 | 1973 | | |
1974 | 1974 | | |
1975 | 1975 | | |
1976 | | - | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
1977 | 1979 | | |
1978 | 1980 | | |
1979 | 1981 | | |
1980 | 1982 | | |
1981 | 1983 | | |
1982 | 1984 | | |
1983 | | - | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
1984 | 1988 | | |
1985 | 1989 | | |
1986 | 1990 | | |
| |||
2078 | 2082 | | |
2079 | 2083 | | |
2080 | 2084 | | |
2081 | | - | |
| 2085 | + | |
2082 | 2086 | | |
2083 | 2087 | | |
2084 | | - | |
| 2088 | + | |
2085 | 2089 | | |
2086 | 2090 | | |
2087 | 2091 | | |
| |||
2095 | 2099 | | |
2096 | 2100 | | |
2097 | 2101 | | |
2098 | | - | |
2099 | | - | |
| 2102 | + | |
| 2103 | + | |
2100 | 2104 | | |
2101 | 2105 | | |
2102 | 2106 | | |
| |||
0 commit comments