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));
166 static int assert_hw(struct perf_evsel *evsel, enum perf_hw_id id, const char *name)
170 if (evsel->attr.type == PERF_TYPE_HARDWARE) {
171 TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, id));
174 pmu = perf_pmus__find_by_type(evsel->attr.type);
183 struct perf_evsel *evsel;
187 perf_evlist__for_each_evsel(&evlist->core, evsel) {
188 int ret = assert_hw(evsel, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
199 struct perf_evsel *evsel;
203 perf_evlist__for_each_evsel(&evlist->core, evsel) {
204 int ret = assert_hw(evsel, PERF_COUNT_HW_CPU_CYCLES, "cycles");
212 TEST_ASSERT_VAL("wrong period", 0 == evsel->attr.sample_period);
213 TEST_ASSERT_VAL("wrong config1", 0 == evsel->attr.config1);
214 TEST_ASSERT_VAL("wrong config2", 1 == evsel->attr.config2);
221 struct evsel *evsel = evlist__first(evlist);
224 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
225 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS));
231 struct perf_evsel *evsel;
235 perf_evlist__for_each_entry(&evlist->core, evsel) {
236 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->attr.type);
237 TEST_ASSERT_VAL("wrong config", test_perf_config(evsel, 1 << 16));
244 struct evsel *evsel = evlist__first(evlist);
247 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
248 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
250 evsel->core.attr.bp_type);
252 evsel->core.attr.bp_len);
258 struct evsel *evsel = evlist__first(evlist);
261 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
262 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
264 HW_BREAKPOINT_X == evsel->core.attr.bp_type);
265 TEST_ASSERT_VAL("wrong bp_len", sizeof(long) == evsel->core.attr.bp_len);
271 struct evsel *evsel = evlist__first(evlist);
275 PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
276 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
278 HW_BREAKPOINT_R == evsel->core.attr.bp_type);
280 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len);
286 struct evsel *evsel = evlist__first(evlist);
290 PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
291 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
293 HW_BREAKPOINT_W == evsel->core.attr.bp_type);
295 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len);
301 struct evsel *evsel = evlist__first(evlist);
305 PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
306 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
308 (HW_BREAKPOINT_R|HW_BREAKPOINT_W) == evsel->core.attr.bp_type);
310 HW_BREAKPOINT_LEN_4 == evsel->core.attr.bp_len);
317 struct evsel *evsel = evlist__first(evlist);
319 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
320 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
321 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
322 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
330 struct perf_evsel *evsel;
334 perf_evlist__for_each_entry(&evlist->core, evsel) {
335 TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user);
336 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
337 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
338 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
347 struct perf_evsel *evsel;
349 perf_evlist__for_each_entry(&evlist->core, evsel) {
350 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
351 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel);
352 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
353 TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip);
360 struct perf_evsel *evsel;
362 perf_evlist__for_each_entry(&evlist->core, evsel) {
363 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
364 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
365 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv);
366 TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip);
373 struct perf_evsel *evsel;
378 perf_evlist__for_each_entry(&evlist->core, evsel) {
379 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
380 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
381 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv);
382 TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
389 struct perf_evsel *evsel;
391 perf_evlist__for_each_entry(&evlist->core, evsel) {
392 TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest);
393 TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host);
400 struct perf_evsel *evsel;
402 perf_evlist__for_each_entry(&evlist->core, evsel) {
403 TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest);
404 TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host);
411 struct evsel *evsel = evlist__first(evlist);
413 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
414 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
415 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
416 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
423 struct perf_evsel *evsel;
425 perf_evlist__for_each_entry(&evlist->core, evsel) {
426 TEST_ASSERT_VAL("wrong exclude_user", evsel->attr.exclude_user);
427 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel);
428 TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
429 TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip);
436 struct evsel *evsel = evlist__first(evlist);
438 TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle);
439 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
440 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
441 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
442 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
443 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
444 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
451 struct evsel *evsel = evlist__first(evlist);
453 TEST_ASSERT_VAL("wrong exclude idle", evsel->core.attr.exclude_idle);
454 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
455 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
456 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
457 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
458 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
459 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
466 struct evsel *evsel = evlist__first(evlist);
469 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
470 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
471 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
472 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
474 !strcmp(evsel__name(evsel), "mem:0:u"));
481 struct evsel *evsel = evlist__first(evlist);
483 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
484 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
485 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
486 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
488 !strcmp(evsel__name(evsel), "mem:0:x:k"));
495 struct evsel *evsel = evlist__first(evlist);
497 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
498 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
499 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
500 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
502 !strcmp(evsel__name(evsel), "mem:0:r:hp"));
509 struct evsel *evsel = evlist__first(evlist);
511 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
512 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
513 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
514 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
516 !strcmp(evsel__name(evsel), "mem:0:w:up"));
523 struct evsel *evsel = evlist__first(evlist);
525 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
526 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
527 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
528 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
530 !strcmp(evsel__name(evsel), "mem:0:rw:kp"));
537 struct evsel *evsel = evlist__first(evlist);
539 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
540 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
541 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
542 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
544 !strcmp(evsel__name(evsel), "breakpoint"));
551 struct evsel *evsel = evlist__first(evlist);
553 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
554 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
555 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
556 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
558 !strcmp(evsel__name(evsel), "breakpoint"));
565 struct evsel *evsel = evlist__first(evlist);
567 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
568 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
569 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
570 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
572 !strcmp(evsel__name(evsel), "breakpoint"));
579 struct evsel *evsel = evlist__first(evlist);
581 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
582 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
583 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
584 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
586 !strcmp(evsel__name(evsel), "breakpoint"));
593 struct evsel *evsel = evlist__first(evlist);
595 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
596 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
597 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
598 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
600 !strcmp(evsel__name(evsel), "breakpoint"));
607 struct evsel *evsel = evlist__first(evlist);
611 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
612 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "breakpoint1"));
614 evsel = evsel__next(evsel);
616 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
617 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "breakpoint2"));
625 struct evsel *evsel = evlist__first(evlist);
628 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
629 TEST_ASSERT_VAL("wrong config", test_config(evsel, 10));
630 TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1);
631 TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2);
632 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3);
637 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period);
645 struct evsel *evsel = evlist__first(evlist);
650 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT != evsel->core.attr.type);
651 while (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) {
652 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
653 TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1);
654 TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2);
655 TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3);
656 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
657 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
658 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
659 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
660 evsel = evsel__next(evsel);
664 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type);
666 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type);
667 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period);
668 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
669 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
670 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
671 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
674 evsel = evsel__next(evsel);
675 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type);
676 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
677 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
678 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
679 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
680 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
688 struct evsel *evsel = evlist__first(evlist);
692 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
693 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
694 TEST_ASSERT_VAL("wrong name", !strcmp(evsel__name(evsel), "krava"));
697 evsel = evsel__next(evsel);
699 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
700 TEST_ASSERT_VAL("wrong config", test_config(evsel, 2));
702 !strcmp(evsel__name(evsel), "cpu/config=2/u"));
709 struct evsel *evsel = evlist__first(evlist);
713 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
714 TEST_ASSERT_VAL("wrong config", test_config(evsel, 1));
719 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period);
720 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel));
721 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type));
724 evsel = evsel__next(evsel);
725 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
726 TEST_ASSERT_VAL("wrong config", test_config(evsel, 2));
731 TEST_ASSERT_VAL("wrong period", 0 == evsel->core.attr.sample_period);
732 TEST_ASSERT_VAL("wrong callgraph", !evsel__has_callchain(evsel));
733 TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->core.attr.sample_type));
740 struct evsel *evsel = evlist__first(evlist);
743 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type ||
744 strcmp(evsel->pmu_name, "cpu"));
746 !evsel->core.attr.exclude_user);
748 evsel->core.attr.exclude_kernel);
749 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
750 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
751 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
752 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
760 struct evsel *evsel = NULL;
768 evsel = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
771 !evsel->core.attr.exclude_user);
773 evsel->core.attr.exclude_kernel);
774 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
775 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
776 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
777 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
780 evsel = evsel__next(evsel);
781 TEST_ASSERT_VAL("wrong type", evsel__find_pmu(evsel)->is_core);
783 !evsel->core.attr.exclude_user);
785 evsel->core.attr.exclude_kernel);
786 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
787 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
788 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
789 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.pinned);
876 struct evsel *evsel, *leader;
887 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
888 ret = assert_hw(&evsel->core, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
892 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
893 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
894 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
895 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
896 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
897 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
898 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
899 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
900 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
901 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
904 evsel = evsel__next(evsel);
905 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
909 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
910 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
911 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
913 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
914 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
915 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2);
916 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
917 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
918 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
925 struct evsel *evsel, *leader = NULL;
935 evlist__for_each_entry(evlist, evsel) {
938 if (evsel->core.attr.type == PERF_TYPE_SOFTWARE) {
940 leader = evsel;
942 test_config(evsel, PERF_COUNT_SW_PAGE_FAULTS));
943 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
944 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
945 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
946 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
947 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
948 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
949 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
950 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
951 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
952 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
955 if (evsel->core.attr.type == PERF_TYPE_HARDWARE &&
956 test_config(evsel, PERF_COUNT_HW_CACHE_REFERENCES)) {
958 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
959 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
960 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
961 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
962 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
963 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
964 if (evsel__has_leader(evsel, leader))
965 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
966 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
970 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
974 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
975 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
976 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
977 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
978 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
979 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
980 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
981 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
989 struct evsel *evsel, *group1_leader = NULL, *group2_leader = NULL;
1001 evlist__for_each_entry(evlist, evsel) {
1002 if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT) {
1004 group1_leader = evsel;
1006 evsel->core.attr.sample_type == PERF_TP_SAMPLE_TYPE);
1007 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period);
1008 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1009 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1010 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1011 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1012 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1013 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1014 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1015 TEST_ASSERT_VAL("wrong group name", !strcmp(evsel->group_name, "group1"));
1016 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1017 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1018 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1021 if (evsel->core.attr.type == PERF_TYPE_HARDWARE &&
1022 test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)) {
1023 if (evsel->core.attr.exclude_user) {
1026 evsel->core.attr.exclude_user);
1028 !evsel->core.attr.exclude_kernel);
1029 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1032 evsel->core.attr.exclude_guest);
1034 !evsel->core.attr.exclude_host);
1036 evsel->core.attr.precise_ip == 3);
1037 if (evsel__has_leader(evsel, group1_leader)) {
1038 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1040 evsel__group_idx(evsel) == 1);
1042 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1045 group2_leader = evsel;
1047 !evsel->core.attr.exclude_kernel);
1049 !evsel->core.attr.exclude_hv);
1051 !evsel->core.attr.exclude_guest);
1053 evsel->core.attr.exclude_host);
1054 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1055 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1056 if (evsel->core.nr_members == 2) {
1058 evsel__group_idx(evsel) == 0);
1060 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1064 if (evsel->core.attr.type == 1) {
1066 TEST_ASSERT_VAL("wrong config", test_config(evsel, 3));
1067 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1068 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1069 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1070 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1071 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1072 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1073 if (evsel__has_leader(evsel, group2_leader))
1074 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1075 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1079 ret = assert_hw(&evsel->core, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
1083 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1084 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1085 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1086 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1087 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1088 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1089 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1090 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1098 struct evsel *evsel, *leader;
1109 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1110 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1114 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1115 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1116 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1118 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1119 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1120 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 1);
1121 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1122 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1123 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1124 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1125 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1128 evsel = evsel__next(evsel);
1129 ret = assert_hw(&evsel->core, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
1133 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
1134 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1135 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1137 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1138 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1139 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip == 2);
1140 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1141 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1142 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1149 struct evsel *evsel = NULL, *leader;
1159 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1160 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1164 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1165 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1166 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1167 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1168 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1169 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1170 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1171 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1172 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1173 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1174 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1177 evsel = evsel__next(evsel);
1178 ret = assert_hw(&evsel->core, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
1182 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1183 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1184 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1185 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1186 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1187 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1188 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1189 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1190 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1194 evsel = leader = evsel__next(evsel);
1195 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1199 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1200 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1201 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1202 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1203 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1204 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1205 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1206 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1207 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1208 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1209 TEST_ASSERT_VAL("wrong sample_read", !evsel->sample_read);
1212 evsel = evsel__next(evsel);
1213 ret = assert_hw(&evsel->core, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
1217 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1218 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1219 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1220 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1221 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1222 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1223 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1224 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1228 evsel = evsel__next(evsel);
1229 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1233 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1234 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1235 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1236 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1237 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1238 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1239 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1246 struct evsel *evsel = NULL, *leader;
1257 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1258 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1262 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1263 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1264 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1265 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1266 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1267 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1268 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1269 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1270 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1271 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1274 evsel = evsel__next(evsel);
1275 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1279 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1280 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1281 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1282 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1283 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1284 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1285 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1286 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1293 struct evsel *evsel = NULL, *leader;
1304 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1305 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1309 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1310 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1311 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1312 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1313 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1314 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1315 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1316 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1317 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1318 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1321 evsel = evsel__next(evsel);
1322 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1326 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1327 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1328 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1329 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1330 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1331 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1332 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1333 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1340 struct evsel *evsel = NULL, *leader;
1351 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1352 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1356 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1357 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1358 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1359 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1360 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1361 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1362 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1363 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1364 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1365 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1368 evsel = evsel__next(evsel);
1369 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1373 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1374 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1375 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1376 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1377 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1378 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1379 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1380 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1387 struct evsel *evsel = NULL, *leader;
1398 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1399 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1403 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1404 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1405 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1406 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1407 TEST_ASSERT_VAL("wrong exclude host", evsel->core.attr.exclude_host);
1408 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1409 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1410 TEST_ASSERT_VAL("wrong leader", evsel__is_group_leader(evsel));
1411 TEST_ASSERT_VAL("wrong core.nr_members", evsel->core.nr_members == 2);
1412 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 0);
1415 evsel = evsel__next(evsel);
1416 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1420 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1421 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1422 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1423 TEST_ASSERT_VAL("wrong exclude guest", !evsel->core.attr.exclude_guest);
1424 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1425 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1426 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1427 TEST_ASSERT_VAL("wrong group_idx", evsel__group_idx(evsel) == 1);
1434 struct evsel *evsel = NULL, *leader;
1443 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1444 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1448 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1449 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1450 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1451 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1452 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1453 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1454 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1455 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1456 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1459 evsel = evsel__next(evsel);
1460 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1464 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1465 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1466 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1467 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1468 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1469 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1470 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1471 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1474 evsel = evsel__next(evsel);
1475 ret = assert_hw(&evsel->core, PERF_COUNT_HW_BRANCH_MISSES, "branch-misses");
1479 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1480 TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel);
1481 TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv);
1482 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1483 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1484 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1485 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1486 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1487 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1494 struct evsel *evsel = NULL, *leader;
1503 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1504 ret = assert_hw(&evsel->core, PERF_COUNT_HW_INSTRUCTIONS, "instructions");
1508 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1509 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1510 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1511 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1512 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1513 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1514 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1515 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1516 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1519 evsel = evsel__next(evsel);
1520 ret = assert_hw(&evsel->core, PERF_COUNT_HW_BRANCH_MISSES, "branch-misses");
1524 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1525 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1526 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1527 TEST_ASSERT_VAL("wrong exclude guest", evsel->core.attr.exclude_guest);
1528 TEST_ASSERT_VAL("wrong exclude host", !evsel->core.attr.exclude_host);
1529 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1530 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1531 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1532 TEST_ASSERT_VAL("wrong sample_read", evsel->sample_read);
1539 struct evsel *evsel = NULL;
1545 evsel = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1546 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1547 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1548 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1549 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
1550 TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned);
1557 struct evsel *evsel = NULL, *leader;
1566 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1567 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1571 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1572 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1575 TEST_ASSERT_VAL("wrong pinned", evsel->core.attr.pinned);
1578 evsel = evsel__next(evsel);
1579 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1583 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
1586 evsel = evsel__next(evsel);
1587 ret = assert_hw(&evsel->core, PERF_COUNT_HW_BRANCH_MISSES, "branch-misses");
1591 TEST_ASSERT_VAL("wrong pinned", !evsel->core.attr.pinned);
1598 struct evsel *evsel = evlist__first(evlist);
1600 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1601 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1602 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1603 TEST_ASSERT_VAL("wrong precise_ip", evsel->core.attr.precise_ip);
1604 TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive);
1611 struct evsel *evsel = NULL, *leader;
1620 evsel = leader = (i == 0 ? evlist__first(evlist) : evsel__next(evsel));
1621 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1625 TEST_ASSERT_VAL("wrong group name", !evsel->group_name);
1626 TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
1629 TEST_ASSERT_VAL("wrong exclusive", evsel->core.attr.exclusive);
1632 evsel = evsel__next(evsel);
1633 ret = assert_hw(&evsel->core, PERF_COUNT_HW_CACHE_MISSES, "cache-misses");
1637 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
1640 evsel = evsel__next(evsel);
1641 ret = assert_hw(&evsel->core, PERF_COUNT_HW_BRANCH_MISSES, "branch-misses");
1645 TEST_ASSERT_VAL("wrong exclusive", !evsel->core.attr.exclusive);
1651 struct evsel *evsel = evlist__first(evlist);
1654 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
1655 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
1657 evsel->core.attr.bp_type);
1659 evsel->core.attr.bp_len);
1666 struct evsel *evsel = evlist__first(evlist);
1669 TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->core.attr.type);
1670 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0));
1672 evsel->core.attr.bp_type);
1674 evsel->core.attr.bp_len);
1682 struct evsel *evsel = evlist__first(evlist);
1684 TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user);
1685 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1686 TEST_ASSERT_VAL("wrong exclude_hv", evsel->core.attr.exclude_hv);
1687 TEST_ASSERT_VAL("wrong precise_ip", !evsel->core.attr.precise_ip);
1694 struct evsel *evsel = evlist__first(evlist);
1698 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
1699 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_SW_TASK_CLOCK));
1705 struct evsel *evsel = evlist__first(evlist);
1707 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "insn"));
1713 struct evsel *evsel = evlist__first(evlist);
1715 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "rawpmu"));
1721 struct evsel *evsel = evlist__first(evlist);
1723 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "numpmu"));
1729 struct evsel *evsel = evlist__first(evlist);
1731 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "cachepmu"));
1757 struct evsel *evsel = evlist__first(evlist);
1759 TEST_ASSERT_VAL("wrong name setting", evsel__name_is(evsel, "intel_pt//u"));
1765 struct evsel *evsel = evlist__first(evlist);
1768 evsel__name_is(evsel,
1775 struct evsel *evsel = evlist__first(evlist);
1778 TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
1779 TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a));
1785 struct evsel *evsel = evlist__first(evlist);
1786 int ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1791 TEST_ASSERT_VAL("wrong exclude_kernel", evsel->core.attr.exclude_kernel);
1797 struct evsel *evsel = evlist__first(evlist);
1798 int ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1803 TEST_ASSERT_VAL("wrong exclude_user", evsel->core.attr.exclude_user);
1809 struct evsel *evsel = evlist__first(evlist);
1810 int ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1815 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "name") == 0);
1821 struct evsel *evsel = evlist__first(evlist);
1822 int ret = assert_hw(&evsel->core, PERF_COUNT_HW_CPU_CYCLES, "cycles");
1827 TEST_ASSERT_VAL("wrong name setting", strcmp(evsel->name, "l1d") == 0);
2806 struct evsel *evsel1 = evlist__first(evlist);
2807 struct evsel *evsel2 = evlist__last(evlist);