Skip to content

Commit eb00697

Browse files
captain5050acmel
authored andcommitted
perf x86 test: Update hybrid expectations
The legacy events cpu-cycles and instructions have sysfs event equivalents on x86 (see /sys/devices/cpu_core/events). As sysfs/JSON events are now higher in priority than legacy events this causes the hybrid test expectations not to be met. To fix this switch to legacy events that don't have sysfs versions, namely cpu-cycles becomes cycles and instructions becomes branches. Fixes: a24d9d9 ("perf parse-events: Make legacy events lower priority than sysfs/JSON") Reported-by: Arnaldo Carvalho de Melo <[email protected]> Reviewed-by: Kan Liang <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 346878d commit eb00697

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/perf/arch/x86/tests/hybrid.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int test__hybrid_hw_group_event(struct evlist *evlist)
4747
evsel = evsel__next(evsel);
4848
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
4949
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
50-
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
50+
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_INSTRUCTIONS));
5151
TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
5252
return TEST_OK;
5353
}
@@ -102,7 +102,7 @@ static int test__hybrid_group_modifier1(struct evlist *evlist)
102102
evsel = evsel__next(evsel);
103103
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
104104
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
105-
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
105+
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_INSTRUCTIONS));
106106
TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
107107
TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
108108
TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
@@ -171,27 +171,27 @@ struct evlist_test {
171171

172172
static const struct evlist_test test__hybrid_events[] = {
173173
{
174-
.name = "cpu_core/cpu-cycles/",
174+
.name = "cpu_core/cycles/",
175175
.check = test__hybrid_hw_event_with_pmu,
176176
/* 0 */
177177
},
178178
{
179-
.name = "{cpu_core/cpu-cycles/,cpu_core/instructions/}",
179+
.name = "{cpu_core/cycles/,cpu_core/branches/}",
180180
.check = test__hybrid_hw_group_event,
181181
/* 1 */
182182
},
183183
{
184-
.name = "{cpu-clock,cpu_core/cpu-cycles/}",
184+
.name = "{cpu-clock,cpu_core/cycles/}",
185185
.check = test__hybrid_sw_hw_group_event,
186186
/* 2 */
187187
},
188188
{
189-
.name = "{cpu_core/cpu-cycles/,cpu-clock}",
189+
.name = "{cpu_core/cycles/,cpu-clock}",
190190
.check = test__hybrid_hw_sw_group_event,
191191
/* 3 */
192192
},
193193
{
194-
.name = "{cpu_core/cpu-cycles/k,cpu_core/instructions/u}",
194+
.name = "{cpu_core/cycles/k,cpu_core/branches/u}",
195195
.check = test__hybrid_group_modifier1,
196196
/* 4 */
197197
},

0 commit comments

Comments
 (0)