aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-test.c30
-rw-r--r--tools/perf/util/parse-events.l2
2 files changed, 31 insertions, 1 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
854static 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
865static 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
854static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) 876static 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))
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 05d766e3ecb5..1fcf1bbc5458 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -54,7 +54,7 @@ num_dec [0-9]+
54num_hex 0x[a-fA-F0-9]+ 54num_hex 0x[a-fA-F0-9]+
55num_raw_hex [a-fA-F0-9]+ 55num_raw_hex [a-fA-F0-9]+
56name [a-zA-Z_*?][a-zA-Z0-9_*?]* 56name [a-zA-Z_*?][a-zA-Z0-9_*?]*
57modifier_event [ukhp]{1,5} 57modifier_event [ukhpGH]{1,8}
58modifier_bp [rwx] 58modifier_bp [rwx]
59 59
60%% 60%%