diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-13 15:27:28 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-14 14:53:45 -0500 |
commit | 07ac002f2fcc74c5be47b656d9201d5de84dc53d (patch) | |
tree | 6f43107a76ed87f2b817594d2d62246ab82cfba6 /tools/perf/tests | |
parent | 1483c2ae90738e7453bfe446a3bbcdd0ba9abf36 (diff) |
perf evsel: Introduce is_group_member method
To clarify what is being tested, instead of assuming that evsel->leader
== NULL means either an 'isolated' evsel or a 'group leader'.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-lvdbvimaxw9nc5een5vmem0c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/parse-events.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index f2a82d0158c0..42a0c8cd3cd5 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -521,7 +521,7 @@ static int test__group1(struct perf_evlist *evlist) | |||
521 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 521 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
522 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 522 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
523 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 523 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
524 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 524 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
525 | 525 | ||
526 | /* cycles:upp */ | 526 | /* cycles:upp */ |
527 | evsel = perf_evsel__next(evsel); | 527 | evsel = perf_evsel__next(evsel); |
@@ -557,7 +557,7 @@ static int test__group2(struct perf_evlist *evlist) | |||
557 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 557 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
558 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 558 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
559 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 559 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
560 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 560 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
561 | 561 | ||
562 | /* cache-references + :u modifier */ | 562 | /* cache-references + :u modifier */ |
563 | evsel = perf_evsel__next(evsel); | 563 | evsel = perf_evsel__next(evsel); |
@@ -583,7 +583,7 @@ static int test__group2(struct perf_evlist *evlist) | |||
583 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 583 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
584 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 584 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
585 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 585 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
586 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 586 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
587 | 587 | ||
588 | return 0; | 588 | return 0; |
589 | } | 589 | } |
@@ -606,7 +606,7 @@ static int test__group3(struct perf_evlist *evlist __maybe_unused) | |||
606 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 606 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
607 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 607 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
608 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 608 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
609 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 609 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
610 | TEST_ASSERT_VAL("wrong group name", | 610 | TEST_ASSERT_VAL("wrong group name", |
611 | !strcmp(leader->group_name, "group1")); | 611 | !strcmp(leader->group_name, "group1")); |
612 | 612 | ||
@@ -636,7 +636,7 @@ static int test__group3(struct perf_evlist *evlist __maybe_unused) | |||
636 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 636 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
637 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 637 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
638 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 638 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
639 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 639 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
640 | TEST_ASSERT_VAL("wrong group name", | 640 | TEST_ASSERT_VAL("wrong group name", |
641 | !strcmp(leader->group_name, "group2")); | 641 | !strcmp(leader->group_name, "group2")); |
642 | 642 | ||
@@ -663,7 +663,7 @@ static int test__group3(struct perf_evlist *evlist __maybe_unused) | |||
663 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | 663 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); |
664 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 664 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
665 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 665 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
666 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 666 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
667 | 667 | ||
668 | return 0; | 668 | return 0; |
669 | } | 669 | } |
@@ -687,7 +687,7 @@ static int test__group4(struct perf_evlist *evlist __maybe_unused) | |||
687 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 687 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
688 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 1); | 688 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip == 1); |
689 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 689 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
690 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 690 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
691 | 691 | ||
692 | /* instructions:kp + p */ | 692 | /* instructions:kp + p */ |
693 | evsel = perf_evsel__next(evsel); | 693 | evsel = perf_evsel__next(evsel); |
@@ -724,7 +724,7 @@ static int test__group5(struct perf_evlist *evlist __maybe_unused) | |||
724 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 724 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
725 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 725 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
726 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 726 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
727 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 727 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
728 | 728 | ||
729 | /* instructions + G */ | 729 | /* instructions + G */ |
730 | evsel = perf_evsel__next(evsel); | 730 | evsel = perf_evsel__next(evsel); |
@@ -751,7 +751,7 @@ static int test__group5(struct perf_evlist *evlist __maybe_unused) | |||
751 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | 751 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); |
752 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 752 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
753 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); | 753 | TEST_ASSERT_VAL("wrong group name", !evsel->group_name); |
754 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 754 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
755 | 755 | ||
756 | /* instructions:G */ | 756 | /* instructions:G */ |
757 | evsel = perf_evsel__next(evsel); | 757 | evsel = perf_evsel__next(evsel); |
@@ -777,7 +777,7 @@ static int test__group5(struct perf_evlist *evlist __maybe_unused) | |||
777 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | 777 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); |
778 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | 778 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); |
779 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 779 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
780 | TEST_ASSERT_VAL("wrong leader", evsel->leader == NULL); | 780 | TEST_ASSERT_VAL("wrong leader", !perf_evsel__is_group_member(evsel)); |
781 | 781 | ||
782 | return 0; | 782 | return 0; |
783 | } | 783 | } |