Lines Matching refs:evsel
10 static bool test_config(const struct evsel *evsel, __u64 expected_config) in test_config() argument
12 return (evsel->core.attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_config()
15 static bool test_perf_config(const struct perf_evsel *evsel, __u64 expected_config) in test_perf_config() argument
17 return (evsel->attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_perf_config()
20 static bool test_hybrid_type(const struct evsel *evsel, __u64 expected_config) in test_hybrid_type() argument
22 return (evsel->core.attr.config >> PERF_PMU_TYPE_SHIFT) == expected_config; in test_hybrid_type()
27 struct evsel *evsel = evlist__first(evlist); in test__hybrid_hw_event_with_pmu() local
30 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_event_with_pmu()
31 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_hw_event_with_pmu()
32 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_hw_event_with_pmu()
38 struct evsel *evsel, *leader; in test__hybrid_hw_group_event() local
40 evsel = leader = evlist__first(evlist); 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()
43 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_hw_group_event()
44 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_hw_group_event()
45 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_hw_group_event()
47 evsel = evsel__next(evsel); 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()
49 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_hw_group_event()
50 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_INSTRUCTIONS)); in test__hybrid_hw_group_event()
51 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_hw_group_event()
57 struct evsel *evsel, *leader; in test__hybrid_sw_hw_group_event() local
59 evsel = leader = evlist__first(evlist); 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()
62 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_sw_hw_group_event()
64 evsel = evsel__next(evsel); 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()
66 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_sw_hw_group_event()
67 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_sw_hw_group_event()
68 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_sw_hw_group_event()
74 struct evsel *evsel, *leader; in test__hybrid_hw_sw_group_event() local
76 evsel = leader = evlist__first(evlist); 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()
79 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_hw_sw_group_event()
80 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_hw_sw_group_event()
81 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_hw_sw_group_event()
83 evsel = evsel__next(evsel); 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()
85 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_hw_sw_group_event()
91 struct evsel *evsel, *leader; in test__hybrid_group_modifier1() local
93 evsel = leader = evlist__first(evlist); in test__hybrid_group_modifier1()
95 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_group_modifier1()
96 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_group_modifier1()
97 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_group_modifier1()
98 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 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()
102 evsel = evsel__next(evsel); in test__hybrid_group_modifier1()
103 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_group_modifier1()
104 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_group_modifier1()
105 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_INSTRUCTIONS)); in test__hybrid_group_modifier1()
106 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); 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()
114 struct perf_evsel *evsel; in test__hybrid_raw1() local
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()
121 TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, 0x1a)); in test__hybrid_raw1()
128 struct evsel *evsel = evlist__first(evlist); in test__hybrid_raw2() local
131 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); in test__hybrid_raw2()
132 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a)); in test__hybrid_raw2()
138 struct evsel *evsel = evlist__first(evlist); in test__hybrid_cache_event() local
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()
149 struct evsel *evsel = evlist__first(evlist); in test__checkevent_pmu() local
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()
168 struct evsel *evsel, *leader; in test__hybrid_hw_group_event_2() local
170 evsel = leader = evlist__first(evlist); 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()
173 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_hw_group_event_2()
174 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_hw_group_event_2()
175 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_hw_group_event_2()
177 evsel = evsel__next(evsel); 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()
180 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader)); in test__hybrid_hw_group_event_2()