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 <acme@kernel.org> Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Closes: https://lore.kernel.org/lkml/ZYbm5L7tw7bdpDpE@kernel.org/ Link: https://lore.kernel.org/r/20240103170159.1435753-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 346878d commit eb00697

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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)