From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Signed-off-by: Jacob Shin <jacob.s...@amd.com> --- tools/perf/tests/parse-events.c | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 88e2f44..f9c7666 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -372,6 +372,38 @@ static int test__checkevent_breakpoint_rw_modifier(struct perf_evlist *evlist) return test__checkevent_breakpoint_rw(evlist); } +static int test__checkevent_breakpoint_addrmask(struct perf_evlist *evlist) +{ + struct perf_evsel *evsel = perf_evlist__first(evlist); + + TEST_ASSERT_VAL("wrong bp_addr_mask", 1 == evsel->attr.bp_addr_mask); + + return test__checkevent_breakpoint(evlist); +} + +static int test__checkevent_breakpoint_addrmask_x(struct perf_evlist *evlist) +{ + struct perf_evsel *evsel = perf_evlist__first(evlist); + + TEST_ASSERT_VAL("wrong bp_addr_mask", 1 == evsel->attr.bp_addr_mask); + + return test__checkevent_breakpoint_x(evlist); +} + +static int +test__checkevent_breakpoint_addrmask_rw_modifier(struct perf_evlist *evlist) +{ + struct perf_evsel *evsel = perf_evlist__first(evlist); + + TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); + TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->attr.exclude_kernel); + TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); + TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); + TEST_ASSERT_VAL("wrong bp_addr_mask", 1 == evsel->attr.bp_addr_mask); + + return test__checkevent_breakpoint_rw(evlist); +} + static int test__checkevent_pmu(struct perf_evlist *evlist) { @@ -1187,6 +1219,19 @@ static struct evlist_test test__events[] = { .name = "{cycles:G,cache-misses:H}:uG", .check = test__group_gh4, }, + [38] = { + .name = "mem:0/1", + .check = test__checkevent_breakpoint_addrmask, + }, + + [39] = { + .name = "mem:0/1:x", + .check = test__checkevent_breakpoint_addrmask_x, + }, + [40] = { + .name = "mem:0/1:rw:uk", + .check = test__checkevent_breakpoint_addrmask_rw_modifier, + }, }; static struct evlist_test test__events_pmu[] = { -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/