2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-19 16:14:13 +08:00

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>
This commit is contained in:
Gleb Natapov 2012-04-17 14:13:45 +03:00 committed by Arnaldo Carvalho de Melo
parent 6ffd7bdbf8
commit e7c72d888d
2 changed files with 31 additions and 1 deletions

View File

@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist)
return test__checkevent_symbolic_name(evlist);
}
static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = list_entry(evlist->entries.next,
struct perf_evsel, node);
TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest);
TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host);
return test__checkevent_symbolic_name(evlist);
}
static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = list_entry(evlist->entries.next,
struct perf_evsel, node);
TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest);
TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host);
return test__checkevent_symbolic_name(evlist);
}
static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = list_entry(evlist->entries.next,
@ -1091,6 +1113,14 @@ static struct test__event_st {
.name = "r1,syscalls:sys_enter_open:k,1:1:hp",
.check = test__checkevent_list,
},
{
.name = "instructions:G",
.check = test__checkevent_exclude_host_modifier,
},
{
.name = "instructions:H",
.check = test__checkevent_exclude_guest_modifier,
},
};
#define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st))

View File

@ -54,7 +54,7 @@ num_dec [0-9]+
num_hex 0x[a-fA-F0-9]+
num_raw_hex [a-fA-F0-9]+
name [a-zA-Z_*?][a-zA-Z0-9_*?]*
modifier_event [ukhp]{1,5}
modifier_event [ukhpGH]{1,8}
modifier_bp [rwx]
%%