diff options
author | Gleb Natapov <gleb@redhat.com> | 2012-04-17 07:13:45 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-17 10:20:23 -0400 |
commit | e7c72d888dac2c81003401d663bd8abd68e7c5cd (patch) | |
tree | 867f8b13c22c1da09c434a438de3def636c84849 /tools/perf/builtin-test.c | |
parent | 6ffd7bdbf8516d691974d21098278af65d4817a5 (diff) |
perf tools: Add 'G' and 'H' modifiers to event parsing
They were dropped during conversion of event parser. Add test case to
make sure this will not happen again.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20120417111345.GK11918@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r-- | tools/perf/builtin-test.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 1c5b9801ac61..223ffdcc0fd8 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist) | |||
851 | return test__checkevent_symbolic_name(evlist); | 851 | return test__checkevent_symbolic_name(evlist); |
852 | } | 852 | } |
853 | 853 | ||
854 | static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist) | ||
855 | { | ||
856 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | ||
857 | struct perf_evsel, node); | ||
858 | |||
859 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | ||
860 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | ||
861 | |||
862 | return test__checkevent_symbolic_name(evlist); | ||
863 | } | ||
864 | |||
865 | static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist) | ||
866 | { | ||
867 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | ||
868 | struct perf_evsel, node); | ||
869 | |||
870 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | ||
871 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | ||
872 | |||
873 | return test__checkevent_symbolic_name(evlist); | ||
874 | } | ||
875 | |||
854 | static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) | 876 | static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) |
855 | { | 877 | { |
856 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | 878 | struct perf_evsel *evsel = list_entry(evlist->entries.next, |
@@ -1091,6 +1113,14 @@ static struct test__event_st { | |||
1091 | .name = "r1,syscalls:sys_enter_open:k,1:1:hp", | 1113 | .name = "r1,syscalls:sys_enter_open:k,1:1:hp", |
1092 | .check = test__checkevent_list, | 1114 | .check = test__checkevent_list, |
1093 | }, | 1115 | }, |
1116 | { | ||
1117 | .name = "instructions:G", | ||
1118 | .check = test__checkevent_exclude_host_modifier, | ||
1119 | }, | ||
1120 | { | ||
1121 | .name = "instructions:H", | ||
1122 | .check = test__checkevent_exclude_guest_modifier, | ||
1123 | }, | ||
1094 | }; | 1124 | }; |
1095 | 1125 | ||
1096 | #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) | 1126 | #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) |