.. | .. |
---|
5 | 5 | #include <api/fs/fs.h> |
---|
6 | 6 | #include "tests.h" |
---|
7 | 7 | #include "debug.h" |
---|
8 | | -#include "util.h" |
---|
| 8 | +#include "pmu.h" |
---|
9 | 9 | #include <dirent.h> |
---|
10 | 10 | #include <errno.h> |
---|
11 | 11 | #include <sys/types.h> |
---|
.. | .. |
---|
44 | 44 | } |
---|
45 | 45 | #endif |
---|
46 | 46 | |
---|
47 | | -static int test__checkevent_tracepoint(struct perf_evlist *evlist) |
---|
| 47 | +static int test__checkevent_tracepoint(struct evlist *evlist) |
---|
48 | 48 | { |
---|
49 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 49 | + struct evsel *evsel = evlist__first(evlist); |
---|
50 | 50 | |
---|
51 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
| 51 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
52 | 52 | TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); |
---|
53 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); |
---|
| 53 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
---|
54 | 54 | TEST_ASSERT_VAL("wrong sample_type", |
---|
55 | | - PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); |
---|
56 | | - TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); |
---|
| 55 | + PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
---|
| 56 | + TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); |
---|
57 | 57 | return 0; |
---|
58 | 58 | } |
---|
59 | 59 | |
---|
60 | | -static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist) |
---|
| 60 | +static int test__checkevent_tracepoint_multi(struct evlist *evlist) |
---|
61 | 61 | { |
---|
62 | | - struct perf_evsel *evsel; |
---|
| 62 | + struct evsel *evsel; |
---|
63 | 63 | |
---|
64 | | - TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); |
---|
| 64 | + TEST_ASSERT_VAL("wrong number of entries", evlist->core.nr_entries > 1); |
---|
65 | 65 | TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); |
---|
66 | 66 | |
---|
67 | 67 | evlist__for_each_entry(evlist, evsel) { |
---|
68 | 68 | TEST_ASSERT_VAL("wrong type", |
---|
69 | | - PERF_TYPE_TRACEPOINT == evsel->attr.type); |
---|
| 69 | + PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
---|
70 | 70 | TEST_ASSERT_VAL("wrong sample_type", |
---|
71 | | - PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); |
---|
| 71 | + PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
---|
72 | 72 | TEST_ASSERT_VAL("wrong sample_period", |
---|
73 | | - 1 == evsel->attr.sample_period); |
---|
| 73 | + 1 == evsel->core.attr.sample_period); |
---|
74 | 74 | } |
---|
75 | 75 | return 0; |
---|
76 | 76 | } |
---|
77 | 77 | |
---|
78 | | -static int test__checkevent_raw(struct perf_evlist *evlist) |
---|
| 78 | +static int test__checkevent_raw(struct evlist *evlist) |
---|
79 | 79 | { |
---|
80 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 80 | + struct evsel *evsel = evlist__first(evlist); |
---|
81 | 81 | |
---|
82 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
83 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
84 | | - TEST_ASSERT_VAL("wrong config", 0x1a == evsel->attr.config); |
---|
| 82 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 83 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 84 | + TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); |
---|
85 | 85 | return 0; |
---|
86 | 86 | } |
---|
87 | 87 | |
---|
88 | | -static int test__checkevent_numeric(struct perf_evlist *evlist) |
---|
| 88 | +static int test__checkevent_numeric(struct evlist *evlist) |
---|
89 | 89 | { |
---|
90 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 90 | + struct evsel *evsel = evlist__first(evlist); |
---|
91 | 91 | |
---|
92 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
93 | | - TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); |
---|
94 | | - TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); |
---|
| 92 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 93 | + TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
---|
| 94 | + TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
---|
95 | 95 | return 0; |
---|
96 | 96 | } |
---|
97 | 97 | |
---|
98 | | -static int test__checkevent_symbolic_name(struct perf_evlist *evlist) |
---|
| 98 | +static int test__checkevent_symbolic_name(struct evlist *evlist) |
---|
99 | 99 | { |
---|
100 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 100 | + struct evsel *evsel = evlist__first(evlist); |
---|
101 | 101 | |
---|
102 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
103 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 102 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 103 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
104 | 104 | TEST_ASSERT_VAL("wrong config", |
---|
105 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
| 105 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
106 | 106 | return 0; |
---|
107 | 107 | } |
---|
108 | 108 | |
---|
109 | | -static int test__checkevent_symbolic_name_config(struct perf_evlist *evlist) |
---|
| 109 | +static int test__checkevent_symbolic_name_config(struct evlist *evlist) |
---|
110 | 110 | { |
---|
111 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 111 | + struct evsel *evsel = evlist__first(evlist); |
---|
112 | 112 | |
---|
113 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
114 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 113 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 114 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
115 | 115 | TEST_ASSERT_VAL("wrong config", |
---|
116 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
| 116 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
117 | 117 | /* |
---|
118 | 118 | * The period value gets configured within perf_evlist__config, |
---|
119 | 119 | * while this test executes only parse events method. |
---|
120 | 120 | */ |
---|
121 | 121 | TEST_ASSERT_VAL("wrong period", |
---|
122 | | - 0 == evsel->attr.sample_period); |
---|
| 122 | + 0 == evsel->core.attr.sample_period); |
---|
123 | 123 | TEST_ASSERT_VAL("wrong config1", |
---|
124 | | - 0 == evsel->attr.config1); |
---|
| 124 | + 0 == evsel->core.attr.config1); |
---|
125 | 125 | TEST_ASSERT_VAL("wrong config2", |
---|
126 | | - 1 == evsel->attr.config2); |
---|
| 126 | + 1 == evsel->core.attr.config2); |
---|
127 | 127 | return 0; |
---|
128 | 128 | } |
---|
129 | 129 | |
---|
130 | | -static int test__checkevent_symbolic_alias(struct perf_evlist *evlist) |
---|
| 130 | +static int test__checkevent_symbolic_alias(struct evlist *evlist) |
---|
131 | 131 | { |
---|
132 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 132 | + struct evsel *evsel = evlist__first(evlist); |
---|
133 | 133 | |
---|
134 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
135 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); |
---|
| 134 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 135 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
---|
136 | 136 | TEST_ASSERT_VAL("wrong config", |
---|
137 | | - PERF_COUNT_SW_PAGE_FAULTS == evsel->attr.config); |
---|
| 137 | + PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config); |
---|
138 | 138 | return 0; |
---|
139 | 139 | } |
---|
140 | 140 | |
---|
141 | | -static int test__checkevent_genhw(struct perf_evlist *evlist) |
---|
| 141 | +static int test__checkevent_genhw(struct evlist *evlist) |
---|
142 | 142 | { |
---|
143 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 143 | + struct evsel *evsel = evlist__first(evlist); |
---|
144 | 144 | |
---|
145 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
146 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->attr.type); |
---|
147 | | - TEST_ASSERT_VAL("wrong config", (1 << 16) == evsel->attr.config); |
---|
| 145 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 146 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type); |
---|
| 147 | + TEST_ASSERT_VAL("wrong config", (1 << 16) == evsel->core.attr.config); |
---|
148 | 148 | return 0; |
---|
149 | 149 | } |
---|
150 | 150 | |
---|
151 | | -static int test__checkevent_breakpoint(struct perf_evlist *evlist) |
---|
| 151 | +static int test__checkevent_breakpoint(struct evlist *evlist) |
---|
152 | 152 | { |
---|
153 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 153 | + struct evsel *evsel = evlist__first(evlist); |
---|
154 | 154 | |
---|
155 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
156 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
157 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 155 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 156 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 157 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
158 | 158 | TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == |
---|
159 | | - evsel->attr.bp_type); |
---|
| 159 | + evsel->core.attr.bp_type); |
---|
160 | 160 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_4 == |
---|
161 | | - evsel->attr.bp_len); |
---|
| 161 | + evsel->core.attr.bp_len); |
---|
162 | 162 | return 0; |
---|
163 | 163 | } |
---|
164 | 164 | |
---|
165 | | -static int test__checkevent_breakpoint_x(struct perf_evlist *evlist) |
---|
| 165 | +static int test__checkevent_breakpoint_x(struct evlist *evlist) |
---|
166 | 166 | { |
---|
167 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 167 | + struct evsel *evsel = evlist__first(evlist); |
---|
168 | 168 | |
---|
169 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
170 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
171 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 169 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 170 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 171 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
172 | 172 | TEST_ASSERT_VAL("wrong bp_type", |
---|
173 | | - HW_BREAKPOINT_X == evsel->attr.bp_type); |
---|
174 | | - TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->attr.bp_len); |
---|
| 173 | + HW_BREAKPOINT_X == evsel->core.attr.bp_type); |
---|
| 174 | + TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len); |
---|
175 | 175 | return 0; |
---|
176 | 176 | } |
---|
177 | 177 | |
---|
178 | | -static int test__checkevent_breakpoint_r(struct perf_evlist *evlist) |
---|
| 178 | +static int test__checkevent_breakpoint_r(struct evlist *evlist) |
---|
179 | 179 | { |
---|
180 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 180 | + struct evsel *evsel = evlist__first(evlist); |
---|
181 | 181 | |
---|
182 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
| 182 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
183 | 183 | TEST_ASSERT_VAL("wrong type", |
---|
184 | | - PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
185 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 184 | + PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 185 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
186 | 186 | TEST_ASSERT_VAL("wrong bp_type", |
---|
187 | | - HW_BREAKPOINT_R == evsel->attr.bp_type); |
---|
| 187 | + HW_BREAKPOINT_R == evsel->core.attr.bp_type); |
---|
188 | 188 | TEST_ASSERT_VAL("wrong bp_len", |
---|
189 | | - HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); |
---|
| 189 | + HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); |
---|
190 | 190 | return 0; |
---|
191 | 191 | } |
---|
192 | 192 | |
---|
193 | | -static int test__checkevent_breakpoint_w(struct perf_evlist *evlist) |
---|
| 193 | +static int test__checkevent_breakpoint_w(struct evlist *evlist) |
---|
194 | 194 | { |
---|
195 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 195 | + struct evsel *evsel = evlist__first(evlist); |
---|
196 | 196 | |
---|
197 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
| 197 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
198 | 198 | TEST_ASSERT_VAL("wrong type", |
---|
199 | | - PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
200 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 199 | + PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 200 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
201 | 201 | TEST_ASSERT_VAL("wrong bp_type", |
---|
202 | | - HW_BREAKPOINT_W == evsel->attr.bp_type); |
---|
| 202 | + HW_BREAKPOINT_W == evsel->core.attr.bp_type); |
---|
203 | 203 | TEST_ASSERT_VAL("wrong bp_len", |
---|
204 | | - HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); |
---|
| 204 | + HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); |
---|
205 | 205 | return 0; |
---|
206 | 206 | } |
---|
207 | 207 | |
---|
208 | | -static int test__checkevent_breakpoint_rw(struct perf_evlist *evlist) |
---|
| 208 | +static int test__checkevent_breakpoint_rw(struct evlist *evlist) |
---|
209 | 209 | { |
---|
210 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 210 | + struct evsel *evsel = evlist__first(evlist); |
---|
211 | 211 | |
---|
212 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
| 212 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
213 | 213 | TEST_ASSERT_VAL("wrong type", |
---|
214 | | - PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
215 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 214 | + PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 215 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
216 | 216 | TEST_ASSERT_VAL("wrong bp_type", |
---|
217 | | - (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->attr.bp_type); |
---|
| 217 | + (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->core.attr.bp_type); |
---|
218 | 218 | TEST_ASSERT_VAL("wrong bp_len", |
---|
219 | | - HW_BREAKPOINT_LEN_4 == evsel->attr.bp_len); |
---|
| 219 | + HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len); |
---|
220 | 220 | return 0; |
---|
221 | 221 | } |
---|
222 | 222 | |
---|
223 | | -static int test__checkevent_tracepoint_modifier(struct perf_evlist *evlist) |
---|
| 223 | +static int test__checkevent_tracepoint_modifier(struct evlist *evlist) |
---|
224 | 224 | { |
---|
225 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 225 | + struct evsel *evsel = evlist__first(evlist); |
---|
226 | 226 | |
---|
227 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
228 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
229 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
230 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 227 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 228 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 229 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 230 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
231 | 231 | |
---|
232 | 232 | return test__checkevent_tracepoint(evlist); |
---|
233 | 233 | } |
---|
234 | 234 | |
---|
235 | 235 | static int |
---|
236 | | -test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist) |
---|
| 236 | +test__checkevent_tracepoint_multi_modifier(struct evlist *evlist) |
---|
237 | 237 | { |
---|
238 | | - struct perf_evsel *evsel; |
---|
| 238 | + struct evsel *evsel; |
---|
239 | 239 | |
---|
240 | | - TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); |
---|
| 240 | + TEST_ASSERT_VAL("wrong number of entries", evlist->core.nr_entries > 1); |
---|
241 | 241 | |
---|
242 | 242 | evlist__for_each_entry(evlist, evsel) { |
---|
243 | 243 | TEST_ASSERT_VAL("wrong exclude_user", |
---|
244 | | - !evsel->attr.exclude_user); |
---|
| 244 | + !evsel->core.attr.exclude_user); |
---|
245 | 245 | TEST_ASSERT_VAL("wrong exclude_kernel", |
---|
246 | | - evsel->attr.exclude_kernel); |
---|
247 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
248 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 246 | + evsel->core.attr.exclude_kernel); |
---|
| 247 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 248 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
249 | 249 | } |
---|
250 | 250 | |
---|
251 | 251 | return test__checkevent_tracepoint_multi(evlist); |
---|
252 | 252 | } |
---|
253 | 253 | |
---|
254 | | -static int test__checkevent_raw_modifier(struct perf_evlist *evlist) |
---|
| 254 | +static int test__checkevent_raw_modifier(struct evlist *evlist) |
---|
255 | 255 | { |
---|
256 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 256 | + struct evsel *evsel = evlist__first(evlist); |
---|
257 | 257 | |
---|
258 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
259 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
260 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
261 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 258 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 259 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 260 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 261 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
262 | 262 | |
---|
263 | 263 | return test__checkevent_raw(evlist); |
---|
264 | 264 | } |
---|
265 | 265 | |
---|
266 | | -static int test__checkevent_numeric_modifier(struct perf_evlist *evlist) |
---|
| 266 | +static int test__checkevent_numeric_modifier(struct evlist *evlist) |
---|
267 | 267 | { |
---|
268 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 268 | + struct evsel *evsel = evlist__first(evlist); |
---|
269 | 269 | |
---|
270 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
271 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
272 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
273 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 270 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 271 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 272 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 273 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
274 | 274 | |
---|
275 | 275 | return test__checkevent_numeric(evlist); |
---|
276 | 276 | } |
---|
277 | 277 | |
---|
278 | | -static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist) |
---|
| 278 | +static int test__checkevent_symbolic_name_modifier(struct evlist *evlist) |
---|
279 | 279 | { |
---|
280 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 280 | + struct evsel *evsel = evlist__first(evlist); |
---|
281 | 281 | |
---|
282 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
283 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
284 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
285 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 282 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 283 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 284 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 285 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
286 | 286 | |
---|
287 | 287 | return test__checkevent_symbolic_name(evlist); |
---|
288 | 288 | } |
---|
289 | 289 | |
---|
290 | | -static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist) |
---|
| 290 | +static int test__checkevent_exclude_host_modifier(struct evlist *evlist) |
---|
291 | 291 | { |
---|
292 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 292 | + struct evsel *evsel = evlist__first(evlist); |
---|
293 | 293 | |
---|
294 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
295 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
| 294 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 295 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
296 | 296 | |
---|
297 | 297 | return test__checkevent_symbolic_name(evlist); |
---|
298 | 298 | } |
---|
299 | 299 | |
---|
300 | | -static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist) |
---|
| 300 | +static int test__checkevent_exclude_guest_modifier(struct evlist *evlist) |
---|
301 | 301 | { |
---|
302 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 302 | + struct evsel *evsel = evlist__first(evlist); |
---|
303 | 303 | |
---|
304 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
305 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
| 304 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 305 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
306 | 306 | |
---|
307 | 307 | return test__checkevent_symbolic_name(evlist); |
---|
308 | 308 | } |
---|
309 | 309 | |
---|
310 | | -static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) |
---|
| 310 | +static int test__checkevent_symbolic_alias_modifier(struct evlist *evlist) |
---|
311 | 311 | { |
---|
312 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 312 | + struct evsel *evsel = evlist__first(evlist); |
---|
313 | 313 | |
---|
314 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
315 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
316 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
317 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 314 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 315 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 316 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 317 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
318 | 318 | |
---|
319 | 319 | return test__checkevent_symbolic_alias(evlist); |
---|
320 | 320 | } |
---|
321 | 321 | |
---|
322 | | -static int test__checkevent_genhw_modifier(struct perf_evlist *evlist) |
---|
| 322 | +static int test__checkevent_genhw_modifier(struct evlist *evlist) |
---|
323 | 323 | { |
---|
324 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 324 | + struct evsel *evsel = evlist__first(evlist); |
---|
325 | 325 | |
---|
326 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
327 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
328 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
329 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 326 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 327 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 328 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 329 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
330 | 330 | |
---|
331 | 331 | return test__checkevent_genhw(evlist); |
---|
332 | 332 | } |
---|
333 | 333 | |
---|
334 | | -static int test__checkevent_exclude_idle_modifier(struct perf_evlist *evlist) |
---|
| 334 | +static int test__checkevent_exclude_idle_modifier(struct evlist *evlist) |
---|
335 | 335 | { |
---|
336 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 336 | + struct evsel *evsel = evlist__first(evlist); |
---|
337 | 337 | |
---|
338 | | - TEST_ASSERT_VAL("wrong exclude idle", evsel->attr.exclude_idle); |
---|
339 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
340 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
341 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
342 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
343 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
344 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 338 | + TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle); |
---|
| 339 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 340 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 341 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 342 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 343 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 344 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
345 | 345 | |
---|
346 | 346 | return test__checkevent_symbolic_name(evlist); |
---|
347 | 347 | } |
---|
348 | 348 | |
---|
349 | | -static int test__checkevent_exclude_idle_modifier_1(struct perf_evlist *evlist) |
---|
| 349 | +static int test__checkevent_exclude_idle_modifier_1(struct evlist *evlist) |
---|
350 | 350 | { |
---|
351 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 351 | + struct evsel *evsel = evlist__first(evlist); |
---|
352 | 352 | |
---|
353 | | - TEST_ASSERT_VAL("wrong exclude idle", evsel->attr.exclude_idle); |
---|
354 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
355 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
356 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
357 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
358 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
359 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 353 | + TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle); |
---|
| 354 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 355 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 356 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 357 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 358 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 359 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
360 | 360 | |
---|
361 | 361 | return test__checkevent_symbolic_name(evlist); |
---|
362 | 362 | } |
---|
363 | 363 | |
---|
364 | | -static int test__checkevent_breakpoint_modifier(struct perf_evlist *evlist) |
---|
| 364 | +static int test__checkevent_breakpoint_modifier(struct evlist *evlist) |
---|
365 | 365 | { |
---|
366 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 366 | + struct evsel *evsel = evlist__first(evlist); |
---|
367 | 367 | |
---|
368 | 368 | |
---|
369 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
370 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
371 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
372 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 369 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 370 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 371 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 372 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
373 | 373 | TEST_ASSERT_VAL("wrong name", |
---|
374 | | - !strcmp(perf_evsel__name(evsel), "mem:0:u")); |
---|
| 374 | + !strcmp(evsel__name(evsel), "mem:0:u")); |
---|
375 | 375 | |
---|
376 | 376 | return test__checkevent_breakpoint(evlist); |
---|
377 | 377 | } |
---|
378 | 378 | |
---|
379 | | -static int test__checkevent_breakpoint_x_modifier(struct perf_evlist *evlist) |
---|
| 379 | +static int test__checkevent_breakpoint_x_modifier(struct evlist *evlist) |
---|
380 | 380 | { |
---|
381 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 381 | + struct evsel *evsel = evlist__first(evlist); |
---|
382 | 382 | |
---|
383 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
384 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
385 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
386 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 383 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 384 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 385 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 386 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
387 | 387 | TEST_ASSERT_VAL("wrong name", |
---|
388 | | - !strcmp(perf_evsel__name(evsel), "mem:0:x:k")); |
---|
| 388 | + !strcmp(evsel__name(evsel), "mem:0:x:k")); |
---|
389 | 389 | |
---|
390 | 390 | return test__checkevent_breakpoint_x(evlist); |
---|
391 | 391 | } |
---|
392 | 392 | |
---|
393 | | -static int test__checkevent_breakpoint_r_modifier(struct perf_evlist *evlist) |
---|
| 393 | +static int test__checkevent_breakpoint_r_modifier(struct evlist *evlist) |
---|
394 | 394 | { |
---|
395 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 395 | + struct evsel *evsel = evlist__first(evlist); |
---|
396 | 396 | |
---|
397 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
398 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
399 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
400 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 397 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 398 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 399 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 400 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
401 | 401 | TEST_ASSERT_VAL("wrong name", |
---|
402 | | - !strcmp(perf_evsel__name(evsel), "mem:0:r:hp")); |
---|
| 402 | + !strcmp(evsel__name(evsel), "mem:0:r:hp")); |
---|
403 | 403 | |
---|
404 | 404 | return test__checkevent_breakpoint_r(evlist); |
---|
405 | 405 | } |
---|
406 | 406 | |
---|
407 | | -static int test__checkevent_breakpoint_w_modifier(struct perf_evlist *evlist) |
---|
| 407 | +static int test__checkevent_breakpoint_w_modifier(struct evlist *evlist) |
---|
408 | 408 | { |
---|
409 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 409 | + struct evsel *evsel = evlist__first(evlist); |
---|
410 | 410 | |
---|
411 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
412 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
413 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
414 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 411 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 412 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 413 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 414 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
415 | 415 | TEST_ASSERT_VAL("wrong name", |
---|
416 | | - !strcmp(perf_evsel__name(evsel), "mem:0:w:up")); |
---|
| 416 | + !strcmp(evsel__name(evsel), "mem:0:w:up")); |
---|
417 | 417 | |
---|
418 | 418 | return test__checkevent_breakpoint_w(evlist); |
---|
419 | 419 | } |
---|
420 | 420 | |
---|
421 | | -static int test__checkevent_breakpoint_rw_modifier(struct perf_evlist *evlist) |
---|
| 421 | +static int test__checkevent_breakpoint_rw_modifier(struct evlist *evlist) |
---|
422 | 422 | { |
---|
423 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 423 | + struct evsel *evsel = evlist__first(evlist); |
---|
424 | 424 | |
---|
425 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
426 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
427 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
428 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 425 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 426 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 427 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 428 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
429 | 429 | TEST_ASSERT_VAL("wrong name", |
---|
430 | | - !strcmp(perf_evsel__name(evsel), "mem:0:rw:kp")); |
---|
| 430 | + !strcmp(evsel__name(evsel), "mem:0:rw:kp")); |
---|
431 | 431 | |
---|
432 | 432 | return test__checkevent_breakpoint_rw(evlist); |
---|
433 | 433 | } |
---|
434 | 434 | |
---|
435 | | -static int test__checkevent_pmu(struct perf_evlist *evlist) |
---|
| 435 | +static int test__checkevent_pmu(struct evlist *evlist) |
---|
436 | 436 | { |
---|
437 | 437 | |
---|
438 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 438 | + struct evsel *evsel = evlist__first(evlist); |
---|
439 | 439 | |
---|
440 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
441 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
442 | | - TEST_ASSERT_VAL("wrong config", 10 == evsel->attr.config); |
---|
443 | | - TEST_ASSERT_VAL("wrong config1", 1 == evsel->attr.config1); |
---|
444 | | - TEST_ASSERT_VAL("wrong config2", 3 == evsel->attr.config2); |
---|
| 440 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 441 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 442 | + TEST_ASSERT_VAL("wrong config", 10 == evsel->core.attr.config); |
---|
| 443 | + TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1); |
---|
| 444 | + TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2); |
---|
445 | 445 | /* |
---|
446 | 446 | * The period value gets configured within perf_evlist__config, |
---|
447 | 447 | * while this test executes only parse events method. |
---|
448 | 448 | */ |
---|
449 | | - TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); |
---|
| 449 | + TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); |
---|
450 | 450 | |
---|
451 | 451 | return 0; |
---|
452 | 452 | } |
---|
453 | 453 | |
---|
454 | | -static int test__checkevent_list(struct perf_evlist *evlist) |
---|
| 454 | +static int test__checkevent_list(struct evlist *evlist) |
---|
455 | 455 | { |
---|
456 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 456 | + struct evsel *evsel = evlist__first(evlist); |
---|
457 | 457 | |
---|
458 | | - TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->nr_entries); |
---|
| 458 | + TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); |
---|
459 | 459 | |
---|
460 | 460 | /* r1 */ |
---|
461 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
462 | | - TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); |
---|
463 | | - TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1); |
---|
464 | | - TEST_ASSERT_VAL("wrong config2", 0 == evsel->attr.config2); |
---|
465 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
466 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
467 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
468 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 461 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 462 | + TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
---|
| 463 | + TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1); |
---|
| 464 | + TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2); |
---|
| 465 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 466 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 467 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 468 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
469 | 469 | |
---|
470 | 470 | /* syscalls:sys_enter_openat:k */ |
---|
471 | | - evsel = perf_evsel__next(evsel); |
---|
472 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); |
---|
| 471 | + evsel = evsel__next(evsel); |
---|
| 472 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
---|
473 | 473 | TEST_ASSERT_VAL("wrong sample_type", |
---|
474 | | - PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); |
---|
475 | | - TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); |
---|
476 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
477 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
478 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
479 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 474 | + PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
---|
| 475 | + TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); |
---|
| 476 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 477 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 478 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 479 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
480 | 480 | |
---|
481 | 481 | /* 1:1:hp */ |
---|
482 | | - evsel = perf_evsel__next(evsel); |
---|
483 | | - TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); |
---|
484 | | - TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); |
---|
485 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
486 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
487 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
488 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
| 482 | + evsel = evsel__next(evsel); |
---|
| 483 | + TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
---|
| 484 | + TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
---|
| 485 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 486 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 487 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 488 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
489 | 489 | |
---|
490 | 490 | return 0; |
---|
491 | 491 | } |
---|
492 | 492 | |
---|
493 | | -static int test__checkevent_pmu_name(struct perf_evlist *evlist) |
---|
| 493 | +static int test__checkevent_pmu_name(struct evlist *evlist) |
---|
494 | 494 | { |
---|
495 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 495 | + struct evsel *evsel = evlist__first(evlist); |
---|
496 | 496 | |
---|
497 | 497 | /* cpu/config=1,name=krava/u */ |
---|
498 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
499 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
500 | | - TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); |
---|
501 | | - TEST_ASSERT_VAL("wrong name", !strcmp(perf_evsel__name(evsel), "krava")); |
---|
| 498 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
| 499 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 500 | + TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
---|
| 501 | + TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava")); |
---|
502 | 502 | |
---|
503 | 503 | /* cpu/config=2/u" */ |
---|
504 | | - evsel = perf_evsel__next(evsel); |
---|
505 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
506 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
507 | | - TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); |
---|
| 504 | + evsel = evsel__next(evsel); |
---|
| 505 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
| 506 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 507 | + TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); |
---|
508 | 508 | TEST_ASSERT_VAL("wrong name", |
---|
509 | | - !strcmp(perf_evsel__name(evsel), "cpu/config=2/u")); |
---|
| 509 | + !strcmp(evsel__name(evsel), "cpu/config=2/u")); |
---|
510 | 510 | |
---|
511 | 511 | return 0; |
---|
512 | 512 | } |
---|
513 | 513 | |
---|
514 | | -static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlist) |
---|
| 514 | +static int test__checkevent_pmu_partial_time_callgraph(struct evlist *evlist) |
---|
515 | 515 | { |
---|
516 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 516 | + struct evsel *evsel = evlist__first(evlist); |
---|
517 | 517 | |
---|
518 | 518 | /* cpu/config=1,call-graph=fp,time,period=100000/ */ |
---|
519 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
520 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
521 | | - TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); |
---|
| 519 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
| 520 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 521 | + TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); |
---|
522 | 522 | /* |
---|
523 | 523 | * The period, time and callgraph value gets configured |
---|
524 | 524 | * within perf_evlist__config, |
---|
525 | 525 | * while this test executes only parse events method. |
---|
526 | 526 | */ |
---|
527 | | - TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); |
---|
| 527 | + TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); |
---|
528 | 528 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); |
---|
529 | | - TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); |
---|
| 529 | + TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); |
---|
530 | 530 | |
---|
531 | 531 | /* cpu/config=2,call-graph=no,time=0,period=2000/ */ |
---|
532 | | - evsel = perf_evsel__next(evsel); |
---|
533 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
534 | | - TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); |
---|
| 532 | + evsel = evsel__next(evsel); |
---|
| 533 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
| 534 | + TEST_ASSERT_VAL("wrong config", 2 == evsel->core.attr.config); |
---|
535 | 535 | /* |
---|
536 | 536 | * The period, time and callgraph value gets configured |
---|
537 | 537 | * within perf_evlist__config, |
---|
538 | 538 | * while this test executes only parse events method. |
---|
539 | 539 | */ |
---|
540 | | - TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period); |
---|
| 540 | + TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period); |
---|
541 | 541 | TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel)); |
---|
542 | | - TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); |
---|
| 542 | + TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type)); |
---|
543 | 543 | |
---|
544 | 544 | return 0; |
---|
545 | 545 | } |
---|
546 | 546 | |
---|
547 | | -static int test__checkevent_pmu_events(struct perf_evlist *evlist) |
---|
| 547 | +static int test__checkevent_pmu_events(struct evlist *evlist) |
---|
548 | 548 | { |
---|
549 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 549 | + struct evsel *evsel = evlist__first(evlist); |
---|
550 | 550 | |
---|
551 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
552 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
| 551 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 552 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
553 | 553 | TEST_ASSERT_VAL("wrong exclude_user", |
---|
554 | | - !evsel->attr.exclude_user); |
---|
| 554 | + !evsel->core.attr.exclude_user); |
---|
555 | 555 | TEST_ASSERT_VAL("wrong exclude_kernel", |
---|
556 | | - evsel->attr.exclude_kernel); |
---|
557 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
558 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
559 | | - TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); |
---|
| 556 | + evsel->core.attr.exclude_kernel); |
---|
| 557 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 558 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 559 | + TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
---|
| 560 | + TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); |
---|
560 | 561 | |
---|
561 | 562 | return 0; |
---|
562 | 563 | } |
---|
563 | 564 | |
---|
564 | 565 | |
---|
565 | | -static int test__checkevent_pmu_events_mix(struct perf_evlist *evlist) |
---|
| 566 | +static int test__checkevent_pmu_events_mix(struct evlist *evlist) |
---|
566 | 567 | { |
---|
567 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 568 | + struct evsel *evsel = evlist__first(evlist); |
---|
568 | 569 | |
---|
569 | 570 | /* pmu-event:u */ |
---|
570 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 571 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
571 | 572 | TEST_ASSERT_VAL("wrong exclude_user", |
---|
572 | | - !evsel->attr.exclude_user); |
---|
| 573 | + !evsel->core.attr.exclude_user); |
---|
573 | 574 | TEST_ASSERT_VAL("wrong exclude_kernel", |
---|
574 | | - evsel->attr.exclude_kernel); |
---|
575 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
576 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
577 | | - TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); |
---|
| 575 | + evsel->core.attr.exclude_kernel); |
---|
| 576 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 577 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 578 | + TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
---|
| 579 | + TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); |
---|
578 | 580 | |
---|
579 | 581 | /* cpu/pmu-event/u*/ |
---|
580 | | - evsel = perf_evsel__next(evsel); |
---|
581 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
582 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
---|
| 582 | + evsel = evsel__next(evsel); |
---|
| 583 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
| 584 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); |
---|
583 | 585 | TEST_ASSERT_VAL("wrong exclude_user", |
---|
584 | | - !evsel->attr.exclude_user); |
---|
| 586 | + !evsel->core.attr.exclude_user); |
---|
585 | 587 | TEST_ASSERT_VAL("wrong exclude_kernel", |
---|
586 | | - evsel->attr.exclude_kernel); |
---|
587 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
588 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
589 | | - TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); |
---|
| 588 | + evsel->core.attr.exclude_kernel); |
---|
| 589 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 590 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 591 | + TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
---|
| 592 | + TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.pinned); |
---|
590 | 593 | |
---|
591 | 594 | return 0; |
---|
592 | 595 | } |
---|
.. | .. |
---|
631 | 634 | TEST_ASSERT_VAL("wrong val", term->val.num == 1); |
---|
632 | 635 | TEST_ASSERT_VAL("wrong config", !strcmp(term->config, "umask")); |
---|
633 | 636 | |
---|
| 637 | + /* |
---|
| 638 | + * read |
---|
| 639 | + * |
---|
| 640 | + * The perf_pmu__test_parse_init injects 'read' term into |
---|
| 641 | + * perf_pmu_events_list, so 'read' is evaluated as read term |
---|
| 642 | + * and not as raw event with 'ead' hex value. |
---|
| 643 | + */ |
---|
| 644 | + term = list_entry(term->list.next, struct parse_events_term, list); |
---|
| 645 | + TEST_ASSERT_VAL("wrong type term", |
---|
| 646 | + term->type_term == PARSE_EVENTS__TERM_TYPE_USER); |
---|
| 647 | + TEST_ASSERT_VAL("wrong type val", |
---|
| 648 | + term->type_val == PARSE_EVENTS__TERM_TYPE_NUM); |
---|
| 649 | + TEST_ASSERT_VAL("wrong val", term->val.num == 1); |
---|
| 650 | + TEST_ASSERT_VAL("wrong config", !strcmp(term->config, "read")); |
---|
| 651 | + |
---|
| 652 | + /* |
---|
| 653 | + * r0xead |
---|
| 654 | + * |
---|
| 655 | + * To be still able to pass 'ead' value with 'r' syntax, |
---|
| 656 | + * we added support to parse 'r0xHEX' event. |
---|
| 657 | + */ |
---|
| 658 | + term = list_entry(term->list.next, struct parse_events_term, list); |
---|
| 659 | + TEST_ASSERT_VAL("wrong type term", |
---|
| 660 | + term->type_term == PARSE_EVENTS__TERM_TYPE_CONFIG); |
---|
| 661 | + TEST_ASSERT_VAL("wrong type val", |
---|
| 662 | + term->type_val == PARSE_EVENTS__TERM_TYPE_NUM); |
---|
| 663 | + TEST_ASSERT_VAL("wrong val", term->val.num == 0xead); |
---|
| 664 | + TEST_ASSERT_VAL("wrong config", !term->config); |
---|
634 | 665 | return 0; |
---|
635 | 666 | } |
---|
636 | 667 | |
---|
637 | | -static int test__group1(struct perf_evlist *evlist) |
---|
| 668 | +static int test__group1(struct evlist *evlist) |
---|
638 | 669 | { |
---|
639 | | - struct perf_evsel *evsel, *leader; |
---|
| 670 | + struct evsel *evsel, *leader; |
---|
640 | 671 | |
---|
641 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 672 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
642 | 673 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
643 | 674 | |
---|
644 | 675 | /* instructions:k */ |
---|
645 | | - evsel = leader = perf_evlist__first(evlist); |
---|
646 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 676 | + evsel = leader = evlist__first(evlist); |
---|
| 677 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
647 | 678 | TEST_ASSERT_VAL("wrong config", |
---|
648 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
649 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
650 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
651 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
652 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
653 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
654 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
655 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
656 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
657 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 679 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
| 680 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 681 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 682 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 683 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 684 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 685 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 686 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 687 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 688 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
658 | 689 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
659 | 690 | |
---|
660 | 691 | /* cycles:upp */ |
---|
661 | | - evsel = perf_evsel__next(evsel); |
---|
662 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 692 | + evsel = evsel__next(evsel); |
---|
| 693 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
663 | 694 | TEST_ASSERT_VAL("wrong config", |
---|
664 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
665 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
666 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
667 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
| 695 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 696 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 697 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 698 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
668 | 699 | /* use of precise requires exclude_guest */ |
---|
669 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
670 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
671 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); |
---|
| 700 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 701 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 702 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); |
---|
672 | 703 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
673 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 704 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
674 | 705 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
675 | 706 | |
---|
676 | 707 | return 0; |
---|
677 | 708 | } |
---|
678 | 709 | |
---|
679 | | -static int test__group2(struct perf_evlist *evlist) |
---|
| 710 | +static int test__group2(struct evlist *evlist) |
---|
680 | 711 | { |
---|
681 | | - struct perf_evsel *evsel, *leader; |
---|
| 712 | + struct evsel *evsel, *leader; |
---|
682 | 713 | |
---|
683 | | - TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->nr_entries); |
---|
| 714 | + TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); |
---|
684 | 715 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
685 | 716 | |
---|
686 | 717 | /* faults + :ku modifier */ |
---|
687 | | - evsel = leader = perf_evlist__first(evlist); |
---|
688 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); |
---|
| 718 | + evsel = leader = evlist__first(evlist); |
---|
| 719 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
---|
689 | 720 | TEST_ASSERT_VAL("wrong config", |
---|
690 | | - PERF_COUNT_SW_PAGE_FAULTS == evsel->attr.config); |
---|
691 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
692 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
693 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
694 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
695 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
696 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
697 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
698 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
699 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 721 | + PERF_COUNT_SW_PAGE_FAULTS == evsel->core.attr.config); |
---|
| 722 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 723 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 724 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 725 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 726 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 727 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 728 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 729 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 730 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
700 | 731 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
701 | 732 | |
---|
702 | 733 | /* cache-references + :u modifier */ |
---|
703 | | - evsel = perf_evsel__next(evsel); |
---|
704 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 734 | + evsel = evsel__next(evsel); |
---|
| 735 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
705 | 736 | TEST_ASSERT_VAL("wrong config", |
---|
706 | | - PERF_COUNT_HW_CACHE_REFERENCES == evsel->attr.config); |
---|
707 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
708 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
709 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
710 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
711 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
712 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 737 | + PERF_COUNT_HW_CACHE_REFERENCES == evsel->core.attr.config); |
---|
| 738 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 739 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 740 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 741 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 742 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 743 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
713 | 744 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
714 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 745 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
715 | 746 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
716 | 747 | |
---|
717 | 748 | /* cycles:k */ |
---|
718 | | - evsel = perf_evsel__next(evsel); |
---|
719 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 749 | + evsel = evsel__next(evsel); |
---|
| 750 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
720 | 751 | TEST_ASSERT_VAL("wrong config", |
---|
721 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
722 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
723 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
724 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
725 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
726 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
727 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
728 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
| 752 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 753 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 754 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 755 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 756 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 757 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 758 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 759 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
729 | 760 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
730 | 761 | |
---|
731 | 762 | return 0; |
---|
732 | 763 | } |
---|
733 | 764 | |
---|
734 | | -static int test__group3(struct perf_evlist *evlist __maybe_unused) |
---|
| 765 | +static int test__group3(struct evlist *evlist __maybe_unused) |
---|
735 | 766 | { |
---|
736 | | - struct perf_evsel *evsel, *leader; |
---|
| 767 | + struct evsel *evsel, *leader; |
---|
737 | 768 | |
---|
738 | | - TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->nr_entries); |
---|
| 769 | + TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->core.nr_entries); |
---|
739 | 770 | TEST_ASSERT_VAL("wrong number of groups", 2 == evlist->nr_groups); |
---|
740 | 771 | |
---|
741 | 772 | /* group1 syscalls:sys_enter_openat:H */ |
---|
742 | | - evsel = leader = perf_evlist__first(evlist); |
---|
743 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); |
---|
| 773 | + evsel = leader = evlist__first(evlist); |
---|
| 774 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); |
---|
744 | 775 | TEST_ASSERT_VAL("wrong sample_type", |
---|
745 | | - PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); |
---|
746 | | - TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); |
---|
747 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
748 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
749 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
750 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
751 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
752 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
753 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
| 776 | + PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); |
---|
| 777 | + TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); |
---|
| 778 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 779 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 780 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 781 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 782 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 783 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 784 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
754 | 785 | TEST_ASSERT_VAL("wrong group name", |
---|
755 | 786 | !strcmp(leader->group_name, "group1")); |
---|
756 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
757 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 787 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 788 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
758 | 789 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
759 | 790 | |
---|
760 | 791 | /* group1 cycles:kppp */ |
---|
761 | | - evsel = perf_evsel__next(evsel); |
---|
762 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 792 | + evsel = evsel__next(evsel); |
---|
| 793 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
763 | 794 | TEST_ASSERT_VAL("wrong config", |
---|
764 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
765 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
766 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
767 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
| 795 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 796 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 797 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 798 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
768 | 799 | /* use of precise requires exclude_guest */ |
---|
769 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
770 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
771 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 3); |
---|
| 800 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 801 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 802 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 3); |
---|
772 | 803 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
773 | 804 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
774 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 805 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
775 | 806 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
776 | 807 | |
---|
777 | 808 | /* group2 cycles + G modifier */ |
---|
778 | | - evsel = leader = perf_evsel__next(evsel); |
---|
779 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 809 | + evsel = leader = evsel__next(evsel); |
---|
| 810 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
780 | 811 | TEST_ASSERT_VAL("wrong config", |
---|
781 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
782 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
783 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
784 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
785 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
786 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
787 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
788 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
| 812 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 813 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 814 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 815 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 816 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 817 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 818 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 819 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
789 | 820 | TEST_ASSERT_VAL("wrong group name", |
---|
790 | 821 | !strcmp(leader->group_name, "group2")); |
---|
791 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
792 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 822 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 823 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
793 | 824 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
794 | 825 | |
---|
795 | 826 | /* group2 1:3 + G modifier */ |
---|
796 | | - evsel = perf_evsel__next(evsel); |
---|
797 | | - TEST_ASSERT_VAL("wrong type", 1 == evsel->attr.type); |
---|
798 | | - TEST_ASSERT_VAL("wrong config", 3 == evsel->attr.config); |
---|
799 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
800 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
801 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
802 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
803 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
804 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 827 | + evsel = evsel__next(evsel); |
---|
| 828 | + TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); |
---|
| 829 | + TEST_ASSERT_VAL("wrong config", 3 == evsel->core.attr.config); |
---|
| 830 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 831 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 832 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 833 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 834 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 835 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
805 | 836 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
806 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 837 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
807 | 838 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
808 | 839 | |
---|
809 | 840 | /* instructions:u */ |
---|
810 | | - evsel = perf_evsel__next(evsel); |
---|
811 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 841 | + evsel = evsel__next(evsel); |
---|
| 842 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
812 | 843 | TEST_ASSERT_VAL("wrong config", |
---|
813 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
814 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
815 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
816 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
817 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
818 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
819 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
820 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
| 844 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
| 845 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 846 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 847 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 848 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 849 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 850 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 851 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
821 | 852 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
822 | 853 | |
---|
823 | 854 | return 0; |
---|
824 | 855 | } |
---|
825 | 856 | |
---|
826 | | -static int test__group4(struct perf_evlist *evlist __maybe_unused) |
---|
| 857 | +static int test__group4(struct evlist *evlist __maybe_unused) |
---|
827 | 858 | { |
---|
828 | | - struct perf_evsel *evsel, *leader; |
---|
| 859 | + struct evsel *evsel, *leader; |
---|
829 | 860 | |
---|
830 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 861 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
831 | 862 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
832 | 863 | |
---|
833 | 864 | /* cycles:u + p */ |
---|
834 | | - evsel = leader = perf_evlist__first(evlist); |
---|
835 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 865 | + evsel = leader = evlist__first(evlist); |
---|
| 866 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
836 | 867 | TEST_ASSERT_VAL("wrong config", |
---|
837 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
838 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
839 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
840 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
| 868 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 869 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 870 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 871 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
841 | 872 | /* use of precise requires exclude_guest */ |
---|
842 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
843 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
844 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 1); |
---|
| 873 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 874 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 875 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1); |
---|
845 | 876 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
846 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
847 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
848 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 877 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 878 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 879 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
849 | 880 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
850 | 881 | |
---|
851 | 882 | /* instructions:kp + p */ |
---|
852 | | - evsel = perf_evsel__next(evsel); |
---|
853 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 883 | + evsel = evsel__next(evsel); |
---|
| 884 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
854 | 885 | TEST_ASSERT_VAL("wrong config", |
---|
855 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
856 | | - TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user); |
---|
857 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
858 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
| 886 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
| 887 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
| 888 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 889 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
859 | 890 | /* use of precise requires exclude_guest */ |
---|
860 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
861 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
862 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 2); |
---|
| 891 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 892 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 893 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2); |
---|
863 | 894 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
864 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 895 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
865 | 896 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
866 | 897 | |
---|
867 | 898 | return 0; |
---|
868 | 899 | } |
---|
869 | 900 | |
---|
870 | | -static int test__group5(struct perf_evlist *evlist __maybe_unused) |
---|
| 901 | +static int test__group5(struct evlist *evlist __maybe_unused) |
---|
871 | 902 | { |
---|
872 | | - struct perf_evsel *evsel, *leader; |
---|
| 903 | + struct evsel *evsel, *leader; |
---|
873 | 904 | |
---|
874 | | - TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->nr_entries); |
---|
| 905 | + TEST_ASSERT_VAL("wrong number of entries", 5 == evlist->core.nr_entries); |
---|
875 | 906 | TEST_ASSERT_VAL("wrong number of groups", 2 == evlist->nr_groups); |
---|
876 | 907 | |
---|
877 | 908 | /* cycles + G */ |
---|
878 | | - evsel = leader = perf_evlist__first(evlist); |
---|
879 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 909 | + evsel = leader = evlist__first(evlist); |
---|
| 910 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
880 | 911 | TEST_ASSERT_VAL("wrong config", |
---|
881 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
882 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
883 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
884 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
885 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
886 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
887 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 912 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 913 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 914 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 915 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 916 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 917 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 918 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
888 | 919 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
889 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
890 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
891 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 920 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 921 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 922 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
892 | 923 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
893 | 924 | |
---|
894 | 925 | /* instructions + G */ |
---|
895 | | - evsel = perf_evsel__next(evsel); |
---|
896 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 926 | + evsel = evsel__next(evsel); |
---|
| 927 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
897 | 928 | TEST_ASSERT_VAL("wrong config", |
---|
898 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
899 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
900 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
901 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
902 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
903 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
904 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 929 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
| 930 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 931 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 932 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 933 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 934 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 935 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
905 | 936 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
906 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 937 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
907 | 938 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
908 | 939 | |
---|
909 | 940 | /* cycles:G */ |
---|
910 | | - evsel = leader = perf_evsel__next(evsel); |
---|
911 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 941 | + evsel = leader = evsel__next(evsel); |
---|
| 942 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
912 | 943 | TEST_ASSERT_VAL("wrong config", |
---|
913 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
914 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
915 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
916 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
917 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
918 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
919 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 944 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 945 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 946 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 947 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 948 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 949 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 950 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
920 | 951 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
921 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
922 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
923 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 952 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 953 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 954 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
924 | 955 | TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read); |
---|
925 | 956 | |
---|
926 | 957 | /* instructions:G */ |
---|
927 | | - evsel = perf_evsel__next(evsel); |
---|
928 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 958 | + evsel = evsel__next(evsel); |
---|
| 959 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
929 | 960 | TEST_ASSERT_VAL("wrong config", |
---|
930 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
931 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
932 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
933 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
934 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
935 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
936 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 961 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
| 962 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 963 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 964 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 965 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 966 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 967 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
937 | 968 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
938 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 969 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
939 | 970 | |
---|
940 | 971 | /* cycles */ |
---|
941 | | - evsel = perf_evsel__next(evsel); |
---|
942 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 972 | + evsel = evsel__next(evsel); |
---|
| 973 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
943 | 974 | TEST_ASSERT_VAL("wrong config", |
---|
944 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
945 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
946 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
947 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
948 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
949 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
950 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
951 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
| 975 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 976 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 977 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 978 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 979 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 980 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 981 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
| 982 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
952 | 983 | |
---|
953 | 984 | return 0; |
---|
954 | 985 | } |
---|
955 | 986 | |
---|
956 | | -static int test__group_gh1(struct perf_evlist *evlist) |
---|
| 987 | +static int test__group_gh1(struct evlist *evlist) |
---|
957 | 988 | { |
---|
958 | | - struct perf_evsel *evsel, *leader; |
---|
| 989 | + struct evsel *evsel, *leader; |
---|
959 | 990 | |
---|
960 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 991 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
961 | 992 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
962 | 993 | |
---|
963 | 994 | /* cycles + :H group modifier */ |
---|
964 | | - evsel = leader = perf_evlist__first(evlist); |
---|
965 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 995 | + evsel = leader = evlist__first(evlist); |
---|
| 996 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
966 | 997 | TEST_ASSERT_VAL("wrong config", |
---|
967 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
968 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
969 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
970 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
971 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
972 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
973 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 998 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 999 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1000 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1001 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1002 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1003 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1004 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
974 | 1005 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
975 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
976 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
977 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 1006 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 1007 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 1008 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
978 | 1009 | |
---|
979 | 1010 | /* cache-misses:G + :H group modifier */ |
---|
980 | | - evsel = perf_evsel__next(evsel); |
---|
981 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1011 | + evsel = evsel__next(evsel); |
---|
| 1012 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
982 | 1013 | TEST_ASSERT_VAL("wrong config", |
---|
983 | | - PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); |
---|
984 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
985 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
986 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
987 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
988 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
989 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1014 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1015 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1016 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1017 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1018 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 1019 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1020 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
990 | 1021 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
991 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 1022 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
992 | 1023 | |
---|
993 | 1024 | return 0; |
---|
994 | 1025 | } |
---|
995 | 1026 | |
---|
996 | | -static int test__group_gh2(struct perf_evlist *evlist) |
---|
| 1027 | +static int test__group_gh2(struct evlist *evlist) |
---|
997 | 1028 | { |
---|
998 | | - struct perf_evsel *evsel, *leader; |
---|
| 1029 | + struct evsel *evsel, *leader; |
---|
999 | 1030 | |
---|
1000 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 1031 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
1001 | 1032 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
1002 | 1033 | |
---|
1003 | 1034 | /* cycles + :G group modifier */ |
---|
1004 | | - evsel = leader = perf_evlist__first(evlist); |
---|
1005 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1035 | + evsel = leader = evlist__first(evlist); |
---|
| 1036 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1006 | 1037 | TEST_ASSERT_VAL("wrong config", |
---|
1007 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
1008 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1009 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
1010 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
1011 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
1012 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
1013 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1038 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 1039 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1040 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1041 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1042 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 1043 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 1044 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1014 | 1045 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1015 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
1016 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
1017 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 1046 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 1047 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 1048 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
1018 | 1049 | |
---|
1019 | 1050 | /* cache-misses:H + :G group modifier */ |
---|
1020 | | - evsel = perf_evsel__next(evsel); |
---|
1021 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1051 | + evsel = evsel__next(evsel); |
---|
| 1052 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1022 | 1053 | TEST_ASSERT_VAL("wrong config", |
---|
1023 | | - PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); |
---|
1024 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1025 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
1026 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
1027 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
1028 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1029 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1054 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1055 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1056 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1057 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1058 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 1059 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1060 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1030 | 1061 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1031 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 1062 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
1032 | 1063 | |
---|
1033 | 1064 | return 0; |
---|
1034 | 1065 | } |
---|
1035 | 1066 | |
---|
1036 | | -static int test__group_gh3(struct perf_evlist *evlist) |
---|
| 1067 | +static int test__group_gh3(struct evlist *evlist) |
---|
1037 | 1068 | { |
---|
1038 | | - struct perf_evsel *evsel, *leader; |
---|
| 1069 | + struct evsel *evsel, *leader; |
---|
1039 | 1070 | |
---|
1040 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 1071 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
1041 | 1072 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
1042 | 1073 | |
---|
1043 | 1074 | /* cycles:G + :u group modifier */ |
---|
1044 | | - evsel = leader = perf_evlist__first(evlist); |
---|
1045 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1075 | + evsel = leader = evlist__first(evlist); |
---|
| 1076 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1046 | 1077 | TEST_ASSERT_VAL("wrong config", |
---|
1047 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
1048 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1049 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1050 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1051 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
1052 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
1053 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1078 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 1079 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1080 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1081 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1082 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 1083 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 1084 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1054 | 1085 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1055 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
1056 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
1057 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 1086 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 1087 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 1088 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
1058 | 1089 | |
---|
1059 | 1090 | /* cache-misses:H + :u group modifier */ |
---|
1060 | | - evsel = perf_evsel__next(evsel); |
---|
1061 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1091 | + evsel = evsel__next(evsel); |
---|
| 1092 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1062 | 1093 | TEST_ASSERT_VAL("wrong config", |
---|
1063 | | - PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); |
---|
1064 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1065 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1066 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1067 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
1068 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1069 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1094 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1095 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1096 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1097 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1098 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1099 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1100 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1070 | 1101 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1071 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 1102 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
1072 | 1103 | |
---|
1073 | 1104 | return 0; |
---|
1074 | 1105 | } |
---|
1075 | 1106 | |
---|
1076 | | -static int test__group_gh4(struct perf_evlist *evlist) |
---|
| 1107 | +static int test__group_gh4(struct evlist *evlist) |
---|
1077 | 1108 | { |
---|
1078 | | - struct perf_evsel *evsel, *leader; |
---|
| 1109 | + struct evsel *evsel, *leader; |
---|
1079 | 1110 | |
---|
1080 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 1111 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
1081 | 1112 | TEST_ASSERT_VAL("wrong number of groups", 1 == evlist->nr_groups); |
---|
1082 | 1113 | |
---|
1083 | 1114 | /* cycles:G + :uG group modifier */ |
---|
1084 | | - evsel = leader = perf_evlist__first(evlist); |
---|
1085 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1115 | + evsel = leader = evlist__first(evlist); |
---|
| 1116 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1086 | 1117 | TEST_ASSERT_VAL("wrong config", |
---|
1087 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
1088 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1089 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1090 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1091 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
1092 | | - TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
---|
1093 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1118 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 1119 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1120 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1121 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1122 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 1123 | + TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host); |
---|
| 1124 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1094 | 1125 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1095 | | - TEST_ASSERT_VAL("wrong leader", perf_evsel__is_group_leader(evsel)); |
---|
1096 | | - TEST_ASSERT_VAL("wrong nr_members", evsel->nr_members == 2); |
---|
1097 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 0); |
---|
| 1126 | + TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel)); |
---|
| 1127 | + TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2); |
---|
| 1128 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0); |
---|
1098 | 1129 | |
---|
1099 | 1130 | /* cache-misses:H + :uG group modifier */ |
---|
1100 | | - evsel = perf_evsel__next(evsel); |
---|
1101 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1131 | + evsel = evsel__next(evsel); |
---|
| 1132 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1102 | 1133 | TEST_ASSERT_VAL("wrong config", |
---|
1103 | | - PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); |
---|
1104 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1105 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1106 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1107 | | - TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
---|
1108 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1109 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1134 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1135 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1136 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1137 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1138 | + TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest); |
---|
| 1139 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1140 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1110 | 1141 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1111 | | - TEST_ASSERT_VAL("wrong group_idx", perf_evsel__group_idx(evsel) == 1); |
---|
| 1142 | + TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1); |
---|
1112 | 1143 | |
---|
1113 | 1144 | return 0; |
---|
1114 | 1145 | } |
---|
1115 | 1146 | |
---|
1116 | | -static int test__leader_sample1(struct perf_evlist *evlist) |
---|
| 1147 | +static int test__leader_sample1(struct evlist *evlist) |
---|
1117 | 1148 | { |
---|
1118 | | - struct perf_evsel *evsel, *leader; |
---|
| 1149 | + struct evsel *evsel, *leader; |
---|
1119 | 1150 | |
---|
1120 | | - TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->nr_entries); |
---|
| 1151 | + TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); |
---|
1121 | 1152 | |
---|
1122 | 1153 | /* cycles - sampling group leader */ |
---|
1123 | | - evsel = leader = perf_evlist__first(evlist); |
---|
1124 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1154 | + evsel = leader = evlist__first(evlist); |
---|
| 1155 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1125 | 1156 | TEST_ASSERT_VAL("wrong config", |
---|
1126 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
1127 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1128 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
1129 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
1130 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
1131 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1132 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1157 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 1158 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1159 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1160 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1161 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1162 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1163 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1133 | 1164 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1134 | 1165 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1135 | 1166 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
---|
1136 | 1167 | |
---|
1137 | 1168 | /* cache-misses - not sampling */ |
---|
1138 | | - evsel = perf_evsel__next(evsel); |
---|
1139 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1169 | + evsel = evsel__next(evsel); |
---|
| 1170 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1140 | 1171 | TEST_ASSERT_VAL("wrong config", |
---|
1141 | | - PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); |
---|
1142 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1143 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
1144 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
1145 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
1146 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1147 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1172 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1173 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1174 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1175 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1176 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1177 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1178 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1148 | 1179 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1149 | 1180 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
---|
1150 | 1181 | |
---|
1151 | 1182 | /* branch-misses - not sampling */ |
---|
1152 | | - evsel = perf_evsel__next(evsel); |
---|
1153 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1183 | + evsel = evsel__next(evsel); |
---|
| 1184 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1154 | 1185 | TEST_ASSERT_VAL("wrong config", |
---|
1155 | | - PERF_COUNT_HW_BRANCH_MISSES == evsel->attr.config); |
---|
1156 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1157 | | - TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); |
---|
1158 | | - TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
---|
1159 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
1160 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1161 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1186 | + PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
---|
| 1187 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1188 | + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); |
---|
| 1189 | + TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); |
---|
| 1190 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1191 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1192 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1162 | 1193 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1163 | 1194 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1164 | 1195 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
---|
.. | .. |
---|
1166 | 1197 | return 0; |
---|
1167 | 1198 | } |
---|
1168 | 1199 | |
---|
1169 | | -static int test__leader_sample2(struct perf_evlist *evlist __maybe_unused) |
---|
| 1200 | +static int test__leader_sample2(struct evlist *evlist __maybe_unused) |
---|
1170 | 1201 | { |
---|
1171 | | - struct perf_evsel *evsel, *leader; |
---|
| 1202 | + struct evsel *evsel, *leader; |
---|
1172 | 1203 | |
---|
1173 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
| 1204 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
1174 | 1205 | |
---|
1175 | 1206 | /* instructions - sampling group leader */ |
---|
1176 | | - evsel = leader = perf_evlist__first(evlist); |
---|
1177 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1207 | + evsel = leader = evlist__first(evlist); |
---|
| 1208 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1178 | 1209 | TEST_ASSERT_VAL("wrong config", |
---|
1179 | | - PERF_COUNT_HW_INSTRUCTIONS == evsel->attr.config); |
---|
1180 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1181 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1182 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1183 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
1184 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1185 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1210 | + PERF_COUNT_HW_INSTRUCTIONS == evsel->core.attr.config); |
---|
| 1211 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1212 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1213 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1214 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1215 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1216 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1186 | 1217 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1187 | 1218 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1188 | 1219 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
---|
1189 | 1220 | |
---|
1190 | 1221 | /* branch-misses - not sampling */ |
---|
1191 | | - evsel = perf_evsel__next(evsel); |
---|
1192 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1222 | + evsel = evsel__next(evsel); |
---|
| 1223 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1193 | 1224 | TEST_ASSERT_VAL("wrong config", |
---|
1194 | | - PERF_COUNT_HW_BRANCH_MISSES == evsel->attr.config); |
---|
1195 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1196 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1197 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1198 | | - TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
---|
1199 | | - TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
---|
1200 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1225 | + PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
---|
| 1226 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1227 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1228 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1229 | + TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest); |
---|
| 1230 | + TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host); |
---|
| 1231 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1201 | 1232 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1202 | 1233 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1203 | 1234 | TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read); |
---|
.. | .. |
---|
1205 | 1236 | return 0; |
---|
1206 | 1237 | } |
---|
1207 | 1238 | |
---|
1208 | | -static int test__checkevent_pinned_modifier(struct perf_evlist *evlist) |
---|
| 1239 | +static int test__checkevent_pinned_modifier(struct evlist *evlist) |
---|
1209 | 1240 | { |
---|
1210 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1241 | + struct evsel *evsel = evlist__first(evlist); |
---|
1211 | 1242 | |
---|
1212 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1213 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1214 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1215 | | - TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
---|
1216 | | - TEST_ASSERT_VAL("wrong pinned", evsel->attr.pinned); |
---|
| 1243 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1244 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1245 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1246 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
| 1247 | + TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); |
---|
1217 | 1248 | |
---|
1218 | 1249 | return test__checkevent_symbolic_name(evlist); |
---|
1219 | 1250 | } |
---|
1220 | 1251 | |
---|
1221 | | -static int test__pinned_group(struct perf_evlist *evlist) |
---|
| 1252 | +static int test__pinned_group(struct evlist *evlist) |
---|
1222 | 1253 | { |
---|
1223 | | - struct perf_evsel *evsel, *leader; |
---|
| 1254 | + struct evsel *evsel, *leader; |
---|
1224 | 1255 | |
---|
1225 | | - TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->nr_entries); |
---|
| 1256 | + TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); |
---|
1226 | 1257 | |
---|
1227 | 1258 | /* cycles - group leader */ |
---|
1228 | | - evsel = leader = perf_evlist__first(evlist); |
---|
1229 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1259 | + evsel = leader = evlist__first(evlist); |
---|
| 1260 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1230 | 1261 | TEST_ASSERT_VAL("wrong config", |
---|
1231 | | - PERF_COUNT_HW_CPU_CYCLES == evsel->attr.config); |
---|
| 1262 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
1232 | 1263 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
1233 | 1264 | TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
1234 | | - TEST_ASSERT_VAL("wrong pinned", evsel->attr.pinned); |
---|
| 1265 | + TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned); |
---|
1235 | 1266 | |
---|
1236 | 1267 | /* cache-misses - can not be pinned, but will go on with the leader */ |
---|
1237 | | - evsel = perf_evsel__next(evsel); |
---|
1238 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type); |
---|
| 1268 | + evsel = evsel__next(evsel); |
---|
| 1269 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
1239 | 1270 | TEST_ASSERT_VAL("wrong config", |
---|
1240 | | - PERF_COUNT_HW_CACHE_MISSES == evsel->attr.config); |
---|
1241 | | - TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); |
---|
| 1271 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1272 | + TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
---|
1242 | 1273 | |
---|
1243 | 1274 | /* branch-misses - ditto */ |
---|
1244 | | - evsel = perf_evsel__next(evsel); |
---|
| 1275 | + evsel = evsel__next(evsel); |
---|
1245 | 1276 | TEST_ASSERT_VAL("wrong config", |
---|
1246 | | - PERF_COUNT_HW_BRANCH_MISSES == evsel->attr.config); |
---|
1247 | | - TEST_ASSERT_VAL("wrong pinned", !evsel->attr.pinned); |
---|
| 1277 | + PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
---|
| 1278 | + TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned); |
---|
1248 | 1279 | |
---|
1249 | 1280 | return 0; |
---|
1250 | 1281 | } |
---|
1251 | 1282 | |
---|
1252 | | -static int test__checkevent_breakpoint_len(struct perf_evlist *evlist) |
---|
| 1283 | +static int test__checkevent_exclusive_modifier(struct evlist *evlist) |
---|
1253 | 1284 | { |
---|
1254 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1285 | + struct evsel *evsel = evlist__first(evlist); |
---|
1255 | 1286 | |
---|
1256 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
1257 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
1258 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 1287 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1288 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1289 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1290 | + TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip); |
---|
| 1291 | + TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive); |
---|
| 1292 | + |
---|
| 1293 | + return test__checkevent_symbolic_name(evlist); |
---|
| 1294 | +} |
---|
| 1295 | + |
---|
| 1296 | +static int test__exclusive_group(struct evlist *evlist) |
---|
| 1297 | +{ |
---|
| 1298 | + struct evsel *evsel, *leader; |
---|
| 1299 | + |
---|
| 1300 | + TEST_ASSERT_VAL("wrong number of entries", 3 == evlist->core.nr_entries); |
---|
| 1301 | + |
---|
| 1302 | + /* cycles - group leader */ |
---|
| 1303 | + evsel = leader = evlist__first(evlist); |
---|
| 1304 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
| 1305 | + TEST_ASSERT_VAL("wrong config", |
---|
| 1306 | + PERF_COUNT_HW_CPU_CYCLES == evsel->core.attr.config); |
---|
| 1307 | + TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
---|
| 1308 | + TEST_ASSERT_VAL("wrong leader", evsel->leader == leader); |
---|
| 1309 | + TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive); |
---|
| 1310 | + |
---|
| 1311 | + /* cache-misses - can not be pinned, but will go on with the leader */ |
---|
| 1312 | + evsel = evsel__next(evsel); |
---|
| 1313 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); |
---|
| 1314 | + TEST_ASSERT_VAL("wrong config", |
---|
| 1315 | + PERF_COUNT_HW_CACHE_MISSES == evsel->core.attr.config); |
---|
| 1316 | + TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); |
---|
| 1317 | + |
---|
| 1318 | + /* branch-misses - ditto */ |
---|
| 1319 | + evsel = evsel__next(evsel); |
---|
| 1320 | + TEST_ASSERT_VAL("wrong config", |
---|
| 1321 | + PERF_COUNT_HW_BRANCH_MISSES == evsel->core.attr.config); |
---|
| 1322 | + TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive); |
---|
| 1323 | + |
---|
| 1324 | + return 0; |
---|
| 1325 | +} |
---|
| 1326 | +static int test__checkevent_breakpoint_len(struct evlist *evlist) |
---|
| 1327 | +{ |
---|
| 1328 | + struct evsel *evsel = evlist__first(evlist); |
---|
| 1329 | + |
---|
| 1330 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 1331 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 1332 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
1259 | 1333 | TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) == |
---|
1260 | | - evsel->attr.bp_type); |
---|
| 1334 | + evsel->core.attr.bp_type); |
---|
1261 | 1335 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 == |
---|
1262 | | - evsel->attr.bp_len); |
---|
| 1336 | + evsel->core.attr.bp_len); |
---|
1263 | 1337 | |
---|
1264 | 1338 | return 0; |
---|
1265 | 1339 | } |
---|
1266 | 1340 | |
---|
1267 | | -static int test__checkevent_breakpoint_len_w(struct perf_evlist *evlist) |
---|
| 1341 | +static int test__checkevent_breakpoint_len_w(struct evlist *evlist) |
---|
1268 | 1342 | { |
---|
1269 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1343 | + struct evsel *evsel = evlist__first(evlist); |
---|
1270 | 1344 | |
---|
1271 | | - TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
---|
1272 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type); |
---|
1273 | | - TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config); |
---|
| 1345 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 1346 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type); |
---|
| 1347 | + TEST_ASSERT_VAL("wrong config", 0 == evsel->core.attr.config); |
---|
1274 | 1348 | TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W == |
---|
1275 | | - evsel->attr.bp_type); |
---|
| 1349 | + evsel->core.attr.bp_type); |
---|
1276 | 1350 | TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 == |
---|
1277 | | - evsel->attr.bp_len); |
---|
| 1351 | + evsel->core.attr.bp_len); |
---|
1278 | 1352 | |
---|
1279 | 1353 | return 0; |
---|
1280 | 1354 | } |
---|
1281 | 1355 | |
---|
1282 | 1356 | static int |
---|
1283 | | -test__checkevent_breakpoint_len_rw_modifier(struct perf_evlist *evlist) |
---|
| 1357 | +test__checkevent_breakpoint_len_rw_modifier(struct evlist *evlist) |
---|
1284 | 1358 | { |
---|
1285 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1359 | + struct evsel *evsel = evlist__first(evlist); |
---|
1286 | 1360 | |
---|
1287 | | - TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
---|
1288 | | - TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
---|
1289 | | - TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
---|
1290 | | - TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
---|
| 1361 | + TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); |
---|
| 1362 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1363 | + TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv); |
---|
| 1364 | + TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip); |
---|
1291 | 1365 | |
---|
1292 | 1366 | return test__checkevent_breakpoint_rw(evlist); |
---|
1293 | 1367 | } |
---|
1294 | 1368 | |
---|
1295 | | -static int test__checkevent_precise_max_modifier(struct perf_evlist *evlist) |
---|
| 1369 | +static int test__checkevent_precise_max_modifier(struct evlist *evlist) |
---|
1296 | 1370 | { |
---|
1297 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1371 | + struct evsel *evsel = evlist__first(evlist); |
---|
1298 | 1372 | |
---|
1299 | | - TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); |
---|
1300 | | - TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); |
---|
| 1373 | + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); |
---|
| 1374 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
---|
1301 | 1375 | TEST_ASSERT_VAL("wrong config", |
---|
1302 | | - PERF_COUNT_SW_TASK_CLOCK == evsel->attr.config); |
---|
| 1376 | + PERF_COUNT_SW_TASK_CLOCK == evsel->core.attr.config); |
---|
1303 | 1377 | return 0; |
---|
1304 | 1378 | } |
---|
1305 | 1379 | |
---|
1306 | | -static int test__checkevent_config_symbol(struct perf_evlist *evlist) |
---|
| 1380 | +static int test__checkevent_config_symbol(struct evlist *evlist) |
---|
1307 | 1381 | { |
---|
1308 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1382 | + struct evsel *evsel = evlist__first(evlist); |
---|
1309 | 1383 | |
---|
1310 | 1384 | TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "insn") == 0); |
---|
1311 | 1385 | return 0; |
---|
1312 | 1386 | } |
---|
1313 | 1387 | |
---|
1314 | | -static int test__checkevent_config_raw(struct perf_evlist *evlist) |
---|
| 1388 | +static int test__checkevent_config_raw(struct evlist *evlist) |
---|
1315 | 1389 | { |
---|
1316 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1390 | + struct evsel *evsel = evlist__first(evlist); |
---|
1317 | 1391 | |
---|
1318 | 1392 | TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "rawpmu") == 0); |
---|
1319 | 1393 | return 0; |
---|
1320 | 1394 | } |
---|
1321 | 1395 | |
---|
1322 | | -static int test__checkevent_config_num(struct perf_evlist *evlist) |
---|
| 1396 | +static int test__checkevent_config_num(struct evlist *evlist) |
---|
1323 | 1397 | { |
---|
1324 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1398 | + struct evsel *evsel = evlist__first(evlist); |
---|
1325 | 1399 | |
---|
1326 | 1400 | TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "numpmu") == 0); |
---|
1327 | 1401 | return 0; |
---|
1328 | 1402 | } |
---|
1329 | 1403 | |
---|
1330 | | -static int test__checkevent_config_cache(struct perf_evlist *evlist) |
---|
| 1404 | +static int test__checkevent_config_cache(struct evlist *evlist) |
---|
1331 | 1405 | { |
---|
1332 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1406 | + struct evsel *evsel = evlist__first(evlist); |
---|
1333 | 1407 | |
---|
1334 | 1408 | TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "cachepmu") == 0); |
---|
1335 | 1409 | return 0; |
---|
.. | .. |
---|
1340 | 1414 | return !!perf_pmu__find("intel_pt"); |
---|
1341 | 1415 | } |
---|
1342 | 1416 | |
---|
1343 | | -static int test__intel_pt(struct perf_evlist *evlist) |
---|
| 1417 | +static int test__intel_pt(struct evlist *evlist) |
---|
1344 | 1418 | { |
---|
1345 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1419 | + struct evsel *evsel = evlist__first(evlist); |
---|
1346 | 1420 | |
---|
1347 | 1421 | TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "intel_pt//u") == 0); |
---|
1348 | 1422 | return 0; |
---|
1349 | 1423 | } |
---|
1350 | 1424 | |
---|
1351 | | -static int test__checkevent_complex_name(struct perf_evlist *evlist) |
---|
| 1425 | +static int test__checkevent_complex_name(struct evlist *evlist) |
---|
1352 | 1426 | { |
---|
1353 | | - struct perf_evsel *evsel = perf_evlist__first(evlist); |
---|
| 1427 | + struct evsel *evsel = evlist__first(evlist); |
---|
1354 | 1428 | |
---|
1355 | 1429 | TEST_ASSERT_VAL("wrong complex name parsing", strcmp(evsel->name, "COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks") == 0); |
---|
| 1430 | + return 0; |
---|
| 1431 | +} |
---|
| 1432 | + |
---|
| 1433 | +static int test__checkevent_raw_pmu(struct evlist *evlist) |
---|
| 1434 | +{ |
---|
| 1435 | + struct evsel *evsel = evlist__first(evlist); |
---|
| 1436 | + |
---|
| 1437 | + TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); |
---|
| 1438 | + TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type); |
---|
| 1439 | + TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); |
---|
| 1440 | + return 0; |
---|
| 1441 | +} |
---|
| 1442 | + |
---|
| 1443 | +static int test__sym_event_slash(struct evlist *evlist) |
---|
| 1444 | +{ |
---|
| 1445 | + struct evsel *evsel = evlist__first(evlist); |
---|
| 1446 | + |
---|
| 1447 | + TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); |
---|
| 1448 | + TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES); |
---|
| 1449 | + TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel); |
---|
| 1450 | + return 0; |
---|
| 1451 | +} |
---|
| 1452 | + |
---|
| 1453 | +static int test__sym_event_dc(struct evlist *evlist) |
---|
| 1454 | +{ |
---|
| 1455 | + struct evsel *evsel = evlist__first(evlist); |
---|
| 1456 | + |
---|
| 1457 | + TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE); |
---|
| 1458 | + TEST_ASSERT_VAL("wrong config", evsel->core.attr.config == PERF_COUNT_HW_CPU_CYCLES); |
---|
| 1459 | + TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user); |
---|
1356 | 1460 | return 0; |
---|
1357 | 1461 | } |
---|
1358 | 1462 | |
---|
.. | .. |
---|
1402 | 1506 | return cnt; |
---|
1403 | 1507 | } |
---|
1404 | 1508 | |
---|
1405 | | -static int test__all_tracepoints(struct perf_evlist *evlist) |
---|
| 1509 | +static int test__all_tracepoints(struct evlist *evlist) |
---|
1406 | 1510 | { |
---|
1407 | 1511 | TEST_ASSERT_VAL("wrong events count", |
---|
1408 | | - count_tracepoints() == evlist->nr_entries); |
---|
| 1512 | + count_tracepoints() == evlist->core.nr_entries); |
---|
1409 | 1513 | |
---|
1410 | 1514 | return test__checkevent_tracepoint_multi(evlist); |
---|
1411 | 1515 | } |
---|
.. | .. |
---|
1415 | 1519 | __u32 type; |
---|
1416 | 1520 | const int id; |
---|
1417 | 1521 | bool (*valid)(void); |
---|
1418 | | - int (*check)(struct perf_evlist *evlist); |
---|
| 1522 | + int (*check)(struct evlist *evlist); |
---|
1419 | 1523 | }; |
---|
1420 | 1524 | |
---|
1421 | 1525 | static struct evlist_test test__events[] = { |
---|
.. | .. |
---|
1697 | 1801 | .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk", |
---|
1698 | 1802 | .check = test__checkevent_complex_name, |
---|
1699 | 1803 | .id = 53 |
---|
1700 | | - } |
---|
| 1804 | + }, |
---|
| 1805 | + { |
---|
| 1806 | + .name = "cycles//u", |
---|
| 1807 | + .check = test__sym_event_slash, |
---|
| 1808 | + .id = 54, |
---|
| 1809 | + }, |
---|
| 1810 | + { |
---|
| 1811 | + .name = "cycles:k", |
---|
| 1812 | + .check = test__sym_event_dc, |
---|
| 1813 | + .id = 55, |
---|
| 1814 | + }, |
---|
| 1815 | + { |
---|
| 1816 | + .name = "instructions:uep", |
---|
| 1817 | + .check = test__checkevent_exclusive_modifier, |
---|
| 1818 | + .id = 56, |
---|
| 1819 | + }, |
---|
| 1820 | + { |
---|
| 1821 | + .name = "{cycles,cache-misses,branch-misses}:e", |
---|
| 1822 | + .check = test__exclusive_group, |
---|
| 1823 | + .id = 57, |
---|
| 1824 | + }, |
---|
1701 | 1825 | }; |
---|
1702 | 1826 | |
---|
1703 | 1827 | static struct evlist_test test__events_pmu[] = { |
---|
.. | .. |
---|
1720 | 1844 | .name = "cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2/ukp", |
---|
1721 | 1845 | .check = test__checkevent_complex_name, |
---|
1722 | 1846 | .id = 3, |
---|
1723 | | - } |
---|
| 1847 | + }, |
---|
| 1848 | + { |
---|
| 1849 | + .name = "software/r1a/", |
---|
| 1850 | + .check = test__checkevent_raw_pmu, |
---|
| 1851 | + .id = 4, |
---|
| 1852 | + }, |
---|
| 1853 | + { |
---|
| 1854 | + .name = "software/r0x1a/", |
---|
| 1855 | + .check = test__checkevent_raw_pmu, |
---|
| 1856 | + .id = 4, |
---|
| 1857 | + }, |
---|
1724 | 1858 | }; |
---|
1725 | 1859 | |
---|
1726 | 1860 | struct terms_test { |
---|
.. | .. |
---|
1731 | 1865 | |
---|
1732 | 1866 | static struct terms_test test__terms[] = { |
---|
1733 | 1867 | [0] = { |
---|
1734 | | - .str = "config=10,config1,config2=3,umask=1", |
---|
| 1868 | + .str = "config=10,config1,config2=3,umask=1,read,r0xead", |
---|
1735 | 1869 | .check = test__checkterms_simple, |
---|
1736 | 1870 | }, |
---|
1737 | 1871 | }; |
---|
1738 | 1872 | |
---|
1739 | 1873 | static int test_event(struct evlist_test *e) |
---|
1740 | 1874 | { |
---|
1741 | | - struct parse_events_error err = { .idx = 0, }; |
---|
1742 | | - struct perf_evlist *evlist; |
---|
| 1875 | + struct parse_events_error err; |
---|
| 1876 | + struct evlist *evlist; |
---|
1743 | 1877 | int ret; |
---|
1744 | 1878 | |
---|
| 1879 | + bzero(&err, sizeof(err)); |
---|
1745 | 1880 | if (e->valid && !e->valid()) { |
---|
1746 | 1881 | pr_debug("... SKIP"); |
---|
1747 | 1882 | return 0; |
---|
1748 | 1883 | } |
---|
1749 | 1884 | |
---|
1750 | | - evlist = perf_evlist__new(); |
---|
| 1885 | + evlist = evlist__new(); |
---|
1751 | 1886 | if (evlist == NULL) |
---|
1752 | 1887 | return -ENOMEM; |
---|
1753 | 1888 | |
---|
.. | .. |
---|
1760 | 1895 | ret = e->check(evlist); |
---|
1761 | 1896 | } |
---|
1762 | 1897 | |
---|
1763 | | - perf_evlist__delete(evlist); |
---|
| 1898 | + evlist__delete(evlist); |
---|
1764 | 1899 | |
---|
1765 | 1900 | return ret; |
---|
1766 | 1901 | } |
---|
.. | .. |
---|
1790 | 1925 | |
---|
1791 | 1926 | INIT_LIST_HEAD(&terms); |
---|
1792 | 1927 | |
---|
| 1928 | + /* |
---|
| 1929 | + * The perf_pmu__test_parse_init prepares perf_pmu_events_list |
---|
| 1930 | + * which gets freed in parse_events_terms. |
---|
| 1931 | + */ |
---|
| 1932 | + if (perf_pmu__test_parse_init()) |
---|
| 1933 | + return -1; |
---|
| 1934 | + |
---|
1793 | 1935 | ret = parse_events_terms(&terms, t->str); |
---|
1794 | 1936 | if (ret) { |
---|
1795 | 1937 | pr_debug("failed to parse terms '%s', err %d\n", |
---|