Lines Matching refs:evsel

3 #include "evsel.h"
37 static bool test_config(const struct evsel *evsel, __u64 expected_config)
39 __u32 type = evsel->core.attr.type;
40 __u64 config = evsel->core.attr.config;
52 static bool test_perf_config(const struct perf_evsel *evsel, __u64 expected_config)
54 return (evsel->attr.config & PERF_HW_EVENT_MASK) == expected_config;
87 struct evsel *evsel = evlist__first(evlist);
91 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type);
93 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type);
94 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period);
100 struct evsel *evsel;
105 evlist__for_each_entry(evlist, evsel) {
107 PERF_TYPE_TRACEPOINT == evsel->core.attr.type);
109 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type);
111 1 == evsel->core.attr.sample_period);
119 struct perf_evsel *evsel;
124 perf_evlist__for_each_evsel(&evlist->core, evsel) {
128 TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, 0x1a));
130 evsel->attr.type == PERF_TYPE_RAW);
141 if (pmu->type == evsel->attr.type) {
157 struct evsel *evsel = evlist__first(evlist);
160 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type);
161 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
167 struct perf_evsel *evsel;
171 perf_evlist__for_each_evsel(&evlist->core, evsel) {
172 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type);
174 test_perf_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
181 struct perf_evsel *evsel;
185 perf_evlist__for_each_evsel(&evlist->core, evsel) {
186 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->attr.type);
187 TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
192 TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period);
193 TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1);
194 TEST_ASSERT_VAL("wrong config2", 1 == evsel->attr.config2);
201 struct evsel *evsel = evlist__first(evlist);
204 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
205 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS));
211 struct perf_evsel *evsel;
215 perf_evlist__for_each_entry(&evlist->core, evsel) {
216 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->attr.type);
217 TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, 1 << 16));
224 struct evsel *evsel = evlist__first(evlist);
227 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
228 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
230 evsel->core.attr.bp_type);
232 evsel->core.attr.bp_len);
238 struct evsel *evsel = evlist__first(evlist);
241 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
242 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
244 HW_BREAKPOINT_X == evsel->core.attr.bp_type);
245 TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len);
251 struct evsel *evsel = evlist__first(evlist);
255 PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
256 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
258 HW_BREAKPOINT_R == evsel->core.attr.bp_type);
260 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len);
266 struct evsel *evsel = evlist__first(evlist);
270 PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
271 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
273 HW_BREAKPOINT_W == evsel->core.attr.bp_type);
275 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len);
281 struct evsel *evsel = evlist__first(evlist);
285 PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
286 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
288 (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->core.attr.bp_type);
290 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len);
297 struct evsel *evsel = evlist__first(evlist);
299 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
300 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
301 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
302 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
310 struct perf_evsel *evsel;
314 perf_evlist__for_each_entry(&evlist->core, evsel) {
315 TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user);
316 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
317 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
318 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
327 struct perf_evsel *evsel;
329 perf_evlist__for_each_entry(&evlist->core, evsel) {
330 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
331 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel);
332 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
333 TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip);
340 struct perf_evsel *evsel;
342 perf_evlist__for_each_entry(&evlist->core, evsel) {
343 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
344 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
345 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv);
346 TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip);
353 struct perf_evsel *evsel;
358 perf_evlist__for_each_entry(&evlist->core, evsel) {
359 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
360 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
361 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv);
362 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
369 struct perf_evsel *evsel;
371 perf_evlist__for_each_entry(&evlist->core, evsel) {
372 TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest);
373 TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host);
380 struct perf_evsel *evsel;
382 perf_evlist__for_each_entry(&evlist->core, evsel) {
383 TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest);
384 TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host);
391 struct evsel *evsel = evlist__first(evlist);
393 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
394 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
395 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
396 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
403 struct perf_evsel *evsel;
405 perf_evlist__for_each_entry(&evlist->core, evsel) {
406 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
407 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel);
408 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
409 TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip);
416 struct evsel *evsel = evlist__first(evlist);
418 TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle);
419 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
420 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
421 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
422 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
423 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
424 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
431 struct evsel *evsel = evlist__first(evlist);
433 TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle);
434 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
435 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
436 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
437 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
438 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
439 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
446 struct evsel *evsel = evlist__first(evlist);
449 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
450 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
451 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
452 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
454 !strcmp(evsel__name(evsel), "mem:0:u"));
461 struct evsel *evsel = evlist__first(evlist);
463 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
464 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
465 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
466 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
468 !strcmp(evsel__name(evsel), "mem:0:x:k"));
475 struct evsel *evsel = evlist__first(evlist);
477 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
478 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
479 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
480 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
482 !strcmp(evsel__name(evsel), "mem:0:r:hp"));
489 struct evsel *evsel = evlist__first(evlist);
491 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
492 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
493 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
494 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
496 !strcmp(evsel__name(evsel), "mem:0:w:up"));
503 struct evsel *evsel = evlist__first(evlist);
505 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
506 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
507 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
508 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
510 !strcmp(evsel__name(evsel), "mem:0:rw:kp"));
517 struct evsel *evsel = evlist__first(evlist);
519 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
520 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
521 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
522 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
524 !strcmp(evsel__name(evsel), "breakpoint"));
531 struct evsel *evsel = evlist__first(evlist);
533 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
534 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
535 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
536 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
538 !strcmp(evsel__name(evsel), "breakpoint"));
545 struct evsel *evsel = evlist__first(evlist);
547 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
548 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
549 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
550 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
552 !strcmp(evsel__name(evsel), "breakpoint"));
559 struct evsel *evsel = evlist__first(evlist);
561 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
562 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
563 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
564 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
566 !strcmp(evsel__name(evsel), "breakpoint"));
573 struct evsel *evsel = evlist__first(evlist);
575 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
576 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
577 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
578 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
580 !strcmp(evsel__name(evsel), "breakpoint"));
587 struct evsel *evsel = evlist__first(evlist);
591 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
592 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "breakpoint1"));
594 evsel = evsel__next(evsel);
596 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
597 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "breakpoint2"));
605 struct evsel *evsel = evlist__first(evlist);
608 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
609 TEST_ASSERT_VAL("wrong config", test_config(evsel, 10));
610 TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1);
611 TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2);
612 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3);
617 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period);
625 struct evsel *evsel = evlist__first(evlist);
630 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT != evsel->core.attr.type);
631 while (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) {
632 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
633 TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1);
634 TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2);
635 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3);
636 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
637 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
638 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
639 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
640 evsel = evsel__next(evsel);
644 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type);
646 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type);
647 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period);
648 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
649 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
650 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
651 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
654 evsel = evsel__next(evsel);
655 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type);
656 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
657 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
658 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
659 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
660 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
668 struct evsel *evsel = evlist__first(evlist);
672 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
673 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
674 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava"));
677 evsel = evsel__next(evsel);
679 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
680 TEST_ASSERT_VAL("wrong config", test_config(evsel, 2));
682 !strcmp(evsel__name(evsel), "cpu/config=2/u"));
689 struct evsel *evsel = evlist__first(evlist);
693 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
694 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
699 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period);
700 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel));
701 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type));
704 evsel = evsel__next(evsel);
705 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
706 TEST_ASSERT_VAL("wrong config", test_config(evsel, 2));
711 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period);
712 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel));
713 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type));
720 struct evsel *evsel = evlist__first(evlist);
723 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type ||
724 strcmp(evsel->pmu_name, "cpu"));
726 !evsel->core.attr.exclude_user);
728 evsel->core.attr.exclude_kernel);
729 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
730 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
731 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
732 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
740 struct evsel *evsel = NULL;
748 evsel = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
751 !evsel->core.attr.exclude_user);
753 evsel->core.attr.exclude_kernel);
754 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
755 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
756 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
757 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
760 evsel = evsel__next(evsel);
761 TEST_ASSERT_VAL("wrong type", evsel__find_pmu(evsel)->is_core);
763 !evsel->core.attr.exclude_user);
765 evsel->core.attr.exclude_kernel);
766 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
767 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
768 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
769 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.pinned);
856 struct evsel *evsel, *leader;
865 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
866 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
867 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
868 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
869 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
870 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
871 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
872 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
873 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
874 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
875 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
876 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
877 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
880 evsel = evsel__next(evsel);
881 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
882 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
883 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
884 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
885 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
887 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
888 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
889 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2);
890 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
891 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
892 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
899 struct evsel *evsel, *leader = NULL;
909 evlist__for_each_entry(evlist, evsel) {
910 if (evsel->core.attr.type == PERF_TYPE_SOFTWARE) {
912 leader = evsel;
914 test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS));
915 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
916 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
917 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
918 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
919 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
920 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
921 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
922 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
923 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
924 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
927 if (evsel->core.attr.type == PERF_TYPE_HARDWARE &&
928 test_config(evsel, PERF_COUNT_HW_CACHE_REFERENCES)) {
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);
936 if (evsel__has_leader(evsel, leader))
937 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
938 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
942 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
943 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
944 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
945 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
946 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
947 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
948 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
949 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
950 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
951 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
959 struct evsel *evsel, *group1_leader = NULL, *group2_leader = NULL;
970 evlist__for_each_entry(evlist, evsel) {
971 if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) {
973 group1_leader = evsel;
975 evsel->core.attr.sample_type == PERF_TP_SAMPLE_TYPE);
976 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period);
977 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
978 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
979 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
980 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
981 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
982 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
983 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
984 TEST_ASSERT_VAL("wrong group name", !strcmp(evsel->group_name, "group1"));
985 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
986 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
987 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
990 if (evsel->core.attr.type == PERF_TYPE_HARDWARE &&
991 test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)) {
992 if (evsel->core.attr.exclude_user) {
995 evsel->core.attr.exclude_user);
997 !evsel->core.attr.exclude_kernel);
998 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1001 evsel->core.attr.exclude_guest);
1003 !evsel->core.attr.exclude_host);
1005 evsel->core.attr.precise_ip == 3);
1006 if (evsel__has_leader(evsel, group1_leader)) {
1007 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1009 evsel__group_idx(evsel) == 1);
1011 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1014 group2_leader = evsel;
1016 !evsel->core.attr.exclude_kernel);
1018 !evsel->core.attr.exclude_hv);
1020 !evsel->core.attr.exclude_guest);
1022 evsel->core.attr.exclude_host);
1023 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1024 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1025 if (evsel->core.nr_members == 2) {
1027 evsel__group_idx(evsel) == 0);
1029 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1033 if (evsel->core.attr.type == 1) {
1035 TEST_ASSERT_VAL("wrong config", test_config(evsel, 3));
1036 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1037 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1038 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1039 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1040 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1041 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1042 if (evsel__has_leader(evsel, group2_leader))
1043 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1044 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1048 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1049 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
1050 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1051 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1052 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1053 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1054 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1055 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1056 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1057 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1065 struct evsel *evsel, *leader;
1074 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1075 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1076 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1077 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1078 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1079 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1081 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1082 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1083 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1);
1084 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1085 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1086 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1087 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1088 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1091 evsel = evsel__next(evsel);
1092 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1093 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
1094 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
1095 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1096 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 == 2);
1101 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1102 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1103 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1110 struct evsel *evsel = NULL, *leader;
1119 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1120 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1121 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1122 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1123 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1124 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1125 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1126 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1127 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1128 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1129 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1130 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1131 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1132 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1135 evsel = evsel__next(evsel);
1136 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1137 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
1138 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1139 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1140 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1141 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1142 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1143 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1144 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1145 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1146 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1150 evsel = leader = evsel__next(evsel);
1151 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1152 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1153 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1154 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1155 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1156 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1157 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1158 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1159 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1160 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1161 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1162 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1163 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1166 evsel = evsel__next(evsel);
1167 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1168 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
1169 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1170 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1171 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1172 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1173 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1174 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1175 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1176 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1180 evsel = evsel__next(evsel);
1181 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1182 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1183 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1184 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1185 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1186 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1187 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1188 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1189 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1196 struct evsel *evsel = NULL, *leader;
1205 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1206 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1207 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1208 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1209 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1210 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1211 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1212 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1213 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1214 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1215 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1216 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1217 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1220 evsel = evsel__next(evsel);
1221 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1222 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1223 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1224 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1225 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1226 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1227 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1228 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1229 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1230 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1237 struct evsel *evsel = NULL, *leader;
1246 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1247 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1248 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1249 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1250 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1251 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1252 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1253 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1254 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1255 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1256 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1257 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1258 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1261 evsel = evsel__next(evsel);
1262 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1263 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1264 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1265 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1266 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1267 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1268 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1269 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1270 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1271 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1278 struct evsel *evsel = NULL, *leader;
1287 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1288 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1289 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1290 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1291 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1292 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1293 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1294 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1295 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1296 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1297 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1298 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1299 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1302 evsel = evsel__next(evsel);
1303 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1304 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1305 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1306 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1307 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1308 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1309 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1310 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1311 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1312 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1319 struct evsel *evsel = NULL, *leader;
1328 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1329 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1330 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1331 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1332 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1333 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1334 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1335 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1336 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1337 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1338 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1339 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1340 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1343 evsel = evsel__next(evsel);
1344 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1345 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1346 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1347 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1348 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1349 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1350 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1351 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1352 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1353 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1360 struct evsel *evsel = NULL, *leader;
1367 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1368 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1369 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1370 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1371 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1372 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1373 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1374 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1375 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1376 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1377 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1378 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1381 evsel = evsel__next(evsel);
1382 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1383 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1384 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1385 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1386 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1387 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1388 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1389 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1390 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1391 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1394 evsel = evsel__next(evsel);
1395 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1396 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES));
1397 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1398 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1399 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1400 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1401 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1402 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1403 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1404 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1405 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1412 struct evsel *evsel = NULL, *leader;
1419 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1420 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1421 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_INSTRUCTIONS));
1422 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1423 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1424 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1425 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1426 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1427 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1428 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1429 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1430 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1433 evsel = evsel__next(evsel);
1434 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1435 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES));
1436 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1437 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1438 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1439 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1440 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1441 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1442 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1443 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1444 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1451 struct evsel *evsel = NULL;
1457 evsel = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1458 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1459 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1460 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1461 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
1462 TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned);
1469 struct evsel *evsel = NULL, *leader;
1476 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1477 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1478 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1479 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1480 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1483 TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned);
1486 evsel = evsel__next(evsel);
1487 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1488 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1489 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
1492 evsel = evsel__next(evsel);
1493 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES));
1494 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
1501 struct evsel *evsel = evlist__first(evlist);
1503 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1504 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1505 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1506 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
1507 TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive);
1514 struct evsel *evsel = NULL, *leader;
1521 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1522 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1523 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1524 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1525 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1528 TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive);
1531 evsel = evsel__next(evsel);
1532 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
1533 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CACHE_MISSES));
1534 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
1537 evsel = evsel__next(evsel);
1538 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_BRANCH_MISSES));
1539 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
1545 struct evsel *evsel = evlist__first(evlist);
1548 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
1549 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
1551 evsel->core.attr.bp_type);
1553 evsel->core.attr.bp_len);
1560 struct evsel *evsel = evlist__first(evlist);
1563 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
1564 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
1566 evsel->core.attr.bp_type);
1568 evsel->core.attr.bp_len);
1576 struct evsel *evsel = evlist__first(evlist);
1578 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1579 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1580 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1581 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1588 struct evsel *evsel = evlist__first(evlist);
1592 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
1593 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_TASK_CLOCK));
1599 struct evsel *evsel = evlist__first(evlist);
1601 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "insn"));
1607 struct evsel *evsel = evlist__first(evlist);
1609 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "rawpmu"));
1615 struct evsel *evsel = evlist__first(evlist);
1617 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "numpmu"));
1623 struct evsel *evsel = evlist__first(evlist);
1625 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "cachepmu"));
1651 struct evsel *evsel = evlist__first(evlist);
1653 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "intel_pt//u"));
1659 struct evsel *evsel = evlist__first(evlist);
1662 evsel__name_is(evsel,
1669 struct evsel *evsel = evlist__first(evlist);
1672 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
1673 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a));
1679 struct evsel *evsel = evlist__first(evlist);
1681 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE);
1682 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1683 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1689 struct evsel *evsel = evlist__first(evlist);
1691 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE);
1692 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1693 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
1699 struct evsel *evsel = evlist__first(evlist);
1701 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE);
1702 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1703 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "name") == 0);
1709 struct evsel *evsel = evlist__first(evlist);
1711 TEST_ASSERT_VAL("wrong type", evsel->core.attr.type == PERF_TYPE_HARDWARE);
1712 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
1713 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "l1d") == 0);
2654 struct evsel *evsel1 = evlist__first(evlist);
2655 struct evsel *evsel2 = evlist__last(evlist);