Skip to content

Commit 0b6c537

Browse files
Kan Liangacmel
authored andcommitted
perf tests attr: Add missing topdown metrics events
The Topdown metrics events were added as 'perf stat' default events since commit 42641d6 ("perf stat: Add Topdown metrics events as default events"). However, the perf attr tests were not updated accordingly. The perf attr test fails on the platform which supports Topdown metrics. # perf test 17 17: Setup struct perf_event_attr :FAILED! Add Topdown metrics events into perf attr test cases. Make them optional since they are only available on newer platforms. Fixes: 42641d6 ("perf stat: Add Topdown metrics events as default events") Reported-by: kernel test robot <[email protected]> Signed-off-by: Kan Liang <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 9fce636 commit 0b6c537

File tree

4 files changed

+440
-52
lines changed

4 files changed

+440
-52
lines changed

tools/perf/tests/attr/test-stat-default

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,100 @@ fd=10
6868
type=0
6969
config=5
7070
optional=1
71+
72+
# PERF_TYPE_RAW / slots (0x400)
73+
[event11:base-stat]
74+
fd=11
75+
group_fd=-1
76+
type=4
77+
config=1024
78+
read_format=15
79+
optional=1
80+
81+
# PERF_TYPE_RAW / topdown-retiring (0x8000)
82+
[event12:base-stat]
83+
fd=12
84+
group_fd=11
85+
type=4
86+
config=32768
87+
disabled=0
88+
enable_on_exec=0
89+
read_format=15
90+
optional=1
91+
92+
# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
93+
[event13:base-stat]
94+
fd=13
95+
group_fd=11
96+
type=4
97+
config=33024
98+
disabled=0
99+
enable_on_exec=0
100+
read_format=15
101+
optional=1
102+
103+
# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
104+
[event14:base-stat]
105+
fd=14
106+
group_fd=11
107+
type=4
108+
config=33280
109+
disabled=0
110+
enable_on_exec=0
111+
read_format=15
112+
optional=1
113+
114+
# PERF_TYPE_RAW / topdown-be-bound (0x8300)
115+
[event15:base-stat]
116+
fd=15
117+
group_fd=11
118+
type=4
119+
config=33536
120+
disabled=0
121+
enable_on_exec=0
122+
read_format=15
123+
optional=1
124+
125+
# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
126+
[event16:base-stat]
127+
fd=16
128+
group_fd=11
129+
type=4
130+
config=33792
131+
disabled=0
132+
enable_on_exec=0
133+
read_format=15
134+
optional=1
135+
136+
# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
137+
[event17:base-stat]
138+
fd=17
139+
group_fd=11
140+
type=4
141+
config=34048
142+
disabled=0
143+
enable_on_exec=0
144+
read_format=15
145+
optional=1
146+
147+
# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
148+
[event18:base-stat]
149+
fd=18
150+
group_fd=11
151+
type=4
152+
config=34304
153+
disabled=0
154+
enable_on_exec=0
155+
read_format=15
156+
optional=1
157+
158+
# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
159+
[event19:base-stat]
160+
fd=19
161+
group_fd=11
162+
type=4
163+
config=34560
164+
disabled=0
165+
enable_on_exec=0
166+
read_format=15
167+
optional=1

tools/perf/tests/attr/test-stat-detailed-1

Lines changed: 105 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,109 @@ type=0
7070
config=5
7171
optional=1
7272

73+
# PERF_TYPE_RAW / slots (0x400)
74+
[event11:base-stat]
75+
fd=11
76+
group_fd=-1
77+
type=4
78+
config=1024
79+
read_format=15
80+
optional=1
81+
82+
# PERF_TYPE_RAW / topdown-retiring (0x8000)
83+
[event12:base-stat]
84+
fd=12
85+
group_fd=11
86+
type=4
87+
config=32768
88+
disabled=0
89+
enable_on_exec=0
90+
read_format=15
91+
optional=1
92+
93+
# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94+
[event13:base-stat]
95+
fd=13
96+
group_fd=11
97+
type=4
98+
config=33024
99+
disabled=0
100+
enable_on_exec=0
101+
read_format=15
102+
optional=1
103+
104+
# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105+
[event14:base-stat]
106+
fd=14
107+
group_fd=11
108+
type=4
109+
config=33280
110+
disabled=0
111+
enable_on_exec=0
112+
read_format=15
113+
optional=1
114+
115+
# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116+
[event15:base-stat]
117+
fd=15
118+
group_fd=11
119+
type=4
120+
config=33536
121+
disabled=0
122+
enable_on_exec=0
123+
read_format=15
124+
optional=1
125+
126+
# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127+
[event16:base-stat]
128+
fd=16
129+
group_fd=11
130+
type=4
131+
config=33792
132+
disabled=0
133+
enable_on_exec=0
134+
read_format=15
135+
optional=1
136+
137+
# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138+
[event17:base-stat]
139+
fd=17
140+
group_fd=11
141+
type=4
142+
config=34048
143+
disabled=0
144+
enable_on_exec=0
145+
read_format=15
146+
optional=1
147+
148+
# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149+
[event18:base-stat]
150+
fd=18
151+
group_fd=11
152+
type=4
153+
config=34304
154+
disabled=0
155+
enable_on_exec=0
156+
read_format=15
157+
optional=1
158+
159+
# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160+
[event19:base-stat]
161+
fd=19
162+
group_fd=11
163+
type=4
164+
config=34560
165+
disabled=0
166+
enable_on_exec=0
167+
read_format=15
168+
optional=1
169+
73170
# PERF_TYPE_HW_CACHE /
74171
# PERF_COUNT_HW_CACHE_L1D << 0 |
75172
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76173
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77-
[event11:base-stat]
78-
fd=11
174+
[event20:base-stat]
175+
fd=20
79176
type=3
80177
config=0
81178
optional=1
@@ -84,8 +181,8 @@ optional=1
84181
# PERF_COUNT_HW_CACHE_L1D << 0 |
85182
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86183
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87-
[event12:base-stat]
88-
fd=12
184+
[event21:base-stat]
185+
fd=21
89186
type=3
90187
config=65536
91188
optional=1
@@ -94,8 +191,8 @@ optional=1
94191
# PERF_COUNT_HW_CACHE_LL << 0 |
95192
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96193
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97-
[event13:base-stat]
98-
fd=13
194+
[event22:base-stat]
195+
fd=22
99196
type=3
100197
config=2
101198
optional=1
@@ -104,8 +201,8 @@ optional=1
104201
# PERF_COUNT_HW_CACHE_LL << 0 |
105202
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106203
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107-
[event14:base-stat]
108-
fd=14
204+
[event23:base-stat]
205+
fd=23
109206
type=3
110207
config=65538
111208
optional=1

0 commit comments

Comments
 (0)