Lines Matching +full:attr +full:- +full:cnt +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0
2 #include "arch-tests.h"
12 return (evsel->core.attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_config()
17 return (evsel->attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_perf_config()
22 return (evsel->core.attr.config >> PERF_PMU_TYPE_SHIFT) == expected_config; in test_hybrid_type()
29 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); in test__hybrid_hw_event_with_pmu()
30 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_event_with_pmu()
41 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_hw_group_event()
42 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_group_event()
48 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_group_event()
60 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_sw_hw_group_event()
61 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); in test__hybrid_sw_hw_group_event()
65 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_sw_hw_group_event()
77 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_hw_sw_group_event()
78 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_sw_group_event()
84 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); in test__hybrid_hw_sw_group_event()
94 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_group_modifier1()
95 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_group_modifier1()
99 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); in test__hybrid_group_modifier1()
100 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); in test__hybrid_group_modifier1()
103 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_group_modifier1()
107 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); in test__hybrid_group_modifier1()
108 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); in test__hybrid_group_modifier1()
116 perf_evlist__for_each_evsel(&evlist->core, evsel) { in test__hybrid_raw1()
117 struct perf_pmu *pmu = perf_pmus__find_by_type(evsel->attr.type); in test__hybrid_raw1()
120 TEST_ASSERT_VAL("unexpected pmu", !strncmp(pmu->name, "cpu_", 4)); in test__hybrid_raw1()
130 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); in test__hybrid_raw2()
131 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); in test__hybrid_raw2()
140 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); in test__hybrid_cache_event()
141 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); in test__hybrid_cache_event()
142 TEST_ASSERT_VAL("wrong config", 0x2 == (evsel->core.attr.config & 0xffffffff)); in test__hybrid_cache_event()
151 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); in test__checkevent_pmu()
152 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); in test__checkevent_pmu()
153 TEST_ASSERT_VAL("wrong config", 10 == evsel->core.attr.config); in test__checkevent_pmu()
154 TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1); in test__checkevent_pmu()
155 TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2); in test__checkevent_pmu()
156 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); in test__checkevent_pmu()
161 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); in test__checkevent_pmu()
171 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_hw_group_event_2()
172 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_group_event_2()
178 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); in test__hybrid_hw_group_event_2()
179 TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == 0x3c); in test__hybrid_hw_group_event_2()
185 const char *name; member
192 .name = "cpu_core/cycles/",
197 .name = "{cpu_core/cycles/,cpu_core/branches/}",
202 .name = "{cpu-clock,cpu_core/cycles/}",
207 .name = "{cpu_core/cycles/,cpu-clock}",
212 .name = "{cpu_core/cycles/k,cpu_core/branches/u}",
217 .name = "r1a",
222 .name = "cpu_core/r1a/",
227 .name = "cpu_core/config=10,config1,config2=3,period=1000/u",
232 .name = "cpu_core/LLC-loads/",
237 .name = "{cpu_core/cycles/,cpu_core/cpu-cycles/}",
249 if (e->valid && !e->valid()) { in test_event()
260 ret = parse_events(evlist, e->name, &err); in test_event()
262 pr_debug("failed to parse event '%s', err %d\n", e->name, ret); in test_event()
263 parse_events_error__print(&err, e->name); in test_event()
268 ret = e->check(evlist); in test_event()
285 static int test_events(const struct evlist_test *events, int cnt) in test_events() argument
289 for (int i = 0; i < cnt; i++) { in test_events()
293 pr_debug("running test %d '%s'\n", i, e->name); in test_events()
296 pr_debug("Event test failure: test %d '%s'", i, e->name); in test_events()