Commit e7c72d888dac2c81003401d663bd8abd68e7c5cd
Committed by
Arnaldo Carvalho de Melo
1 parent
6ffd7bdbf8
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 2 changed files with 31 additions and 1 deletions Side-by-side Diff
tools/perf/builtin-test.c
... | ... | @@ -851,6 +851,28 @@ |
851 | 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 | 876 | static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) |
855 | 877 | { |
856 | 878 | struct perf_evsel *evsel = list_entry(evlist->entries.next, |
... | ... | @@ -1090,6 +1112,14 @@ |
1090 | 1112 | { |
1091 | 1113 | .name = "r1,syscalls:sys_enter_open:k,1:1:hp", |
1092 | 1114 | .check = test__checkevent_list, |
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, | |
1093 | 1123 | }, |
1094 | 1124 | }; |
1095 | 1125 |