diff options
Diffstat (limited to 'tools/perf/util/parse-events-test.c')
-rw-r--r-- | tools/perf/util/parse-events-test.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c index bf055ce1916e..bc8b65130ae0 100644 --- a/tools/perf/util/parse-events-test.c +++ b/tools/perf/util/parse-events-test.c | |||
@@ -301,12 +301,13 @@ static int test__checkevent_breakpoint_modifier(struct perf_evlist *evlist) | |||
301 | { | 301 | { |
302 | struct perf_evsel *evsel = perf_evlist__first(evlist); | 302 | struct perf_evsel *evsel = perf_evlist__first(evlist); |
303 | 303 | ||
304 | |||
304 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); | 305 | TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user); |
305 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); | 306 | TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel); |
306 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 307 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
307 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 308 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
308 | TEST_ASSERT_VAL("wrong name", | 309 | TEST_ASSERT_VAL("wrong name", |
309 | !strcmp(perf_evsel__name(evsel), "mem:0x0:rw:u")); | 310 | !strcmp(perf_evsel__name(evsel), "mem:0:u")); |
310 | 311 | ||
311 | return test__checkevent_breakpoint(evlist); | 312 | return test__checkevent_breakpoint(evlist); |
312 | } | 313 | } |
@@ -320,7 +321,7 @@ static int test__checkevent_breakpoint_x_modifier(struct perf_evlist *evlist) | |||
320 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 321 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
321 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); | 322 | TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip); |
322 | TEST_ASSERT_VAL("wrong name", | 323 | TEST_ASSERT_VAL("wrong name", |
323 | !strcmp(perf_evsel__name(evsel), "mem:0x0:x:k")); | 324 | !strcmp(perf_evsel__name(evsel), "mem:0:x:k")); |
324 | 325 | ||
325 | return test__checkevent_breakpoint_x(evlist); | 326 | return test__checkevent_breakpoint_x(evlist); |
326 | } | 327 | } |
@@ -334,7 +335,7 @@ static int test__checkevent_breakpoint_r_modifier(struct perf_evlist *evlist) | |||
334 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); | 335 | TEST_ASSERT_VAL("wrong exclude_hv", !evsel->attr.exclude_hv); |
335 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 336 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
336 | TEST_ASSERT_VAL("wrong name", | 337 | TEST_ASSERT_VAL("wrong name", |
337 | !strcmp(perf_evsel__name(evsel), "mem:0x0:r:hp")); | 338 | !strcmp(perf_evsel__name(evsel), "mem:0:r:hp")); |
338 | 339 | ||
339 | return test__checkevent_breakpoint_r(evlist); | 340 | return test__checkevent_breakpoint_r(evlist); |
340 | } | 341 | } |
@@ -348,7 +349,7 @@ static int test__checkevent_breakpoint_w_modifier(struct perf_evlist *evlist) | |||
348 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 349 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
349 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 350 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
350 | TEST_ASSERT_VAL("wrong name", | 351 | TEST_ASSERT_VAL("wrong name", |
351 | !strcmp(perf_evsel__name(evsel), "mem:0x0:w:up")); | 352 | !strcmp(perf_evsel__name(evsel), "mem:0:w:up")); |
352 | 353 | ||
353 | return test__checkevent_breakpoint_w(evlist); | 354 | return test__checkevent_breakpoint_w(evlist); |
354 | } | 355 | } |
@@ -362,7 +363,7 @@ static int test__checkevent_breakpoint_rw_modifier(struct perf_evlist *evlist) | |||
362 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); | 363 | TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv); |
363 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); | 364 | TEST_ASSERT_VAL("wrong precise_ip", evsel->attr.precise_ip); |
364 | TEST_ASSERT_VAL("wrong name", | 365 | TEST_ASSERT_VAL("wrong name", |
365 | !strcmp(perf_evsel__name(evsel), "mem:0x0:rw:kp")); | 366 | !strcmp(perf_evsel__name(evsel), "mem:0:rw:kp")); |
366 | 367 | ||
367 | return test__checkevent_breakpoint_rw(evlist); | 368 | return test__checkevent_breakpoint_rw(evlist); |
368 | } | 369 | } |
@@ -437,7 +438,7 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist) | |||
437 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 438 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
438 | TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); | 439 | TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); |
439 | TEST_ASSERT_VAL("wrong name", | 440 | TEST_ASSERT_VAL("wrong name", |
440 | !strcmp(perf_evsel__name(evsel), "raw 0x2:u")); | 441 | !strcmp(perf_evsel__name(evsel), "cpu/config=2/u")); |
441 | 442 | ||
442 | return 0; | 443 | return 0; |
443 | } | 444 | } |
@@ -948,19 +949,19 @@ static int test_event(struct test__event_st *e) | |||
948 | 949 | ||
949 | static int test_events(struct test__event_st *events, unsigned cnt) | 950 | static int test_events(struct test__event_st *events, unsigned cnt) |
950 | { | 951 | { |
951 | int ret = 0; | 952 | int ret1, ret2 = 0; |
952 | unsigned i; | 953 | unsigned i; |
953 | 954 | ||
954 | for (i = 0; i < cnt; i++) { | 955 | for (i = 0; i < cnt; i++) { |
955 | struct test__event_st *e = &events[i]; | 956 | struct test__event_st *e = &events[i]; |
956 | 957 | ||
957 | pr_debug("running test %d '%s'\n", i, e->name); | 958 | pr_debug("running test %d '%s'\n", i, e->name); |
958 | ret = test_event(e); | 959 | ret1 = test_event(e); |
959 | if (ret) | 960 | if (ret1) |
960 | break; | 961 | ret2 = ret1; |
961 | } | 962 | } |
962 | 963 | ||
963 | return ret; | 964 | return ret2; |
964 | } | 965 | } |
965 | 966 | ||
966 | static int test_term(struct test__term *t) | 967 | static int test_term(struct test__term *t) |
@@ -1021,13 +1022,13 @@ static int test_pmu(void) | |||
1021 | 1022 | ||
1022 | int parse_events__test(void) | 1023 | int parse_events__test(void) |
1023 | { | 1024 | { |
1024 | int ret; | 1025 | int ret1, ret2 = 0; |
1025 | 1026 | ||
1026 | #define TEST_EVENTS(tests) \ | 1027 | #define TEST_EVENTS(tests) \ |
1027 | do { \ | 1028 | do { \ |
1028 | ret = test_events(tests, ARRAY_SIZE(tests)); \ | 1029 | ret1 = test_events(tests, ARRAY_SIZE(tests)); \ |
1029 | if (ret) \ | 1030 | if (!ret2) \ |
1030 | return ret; \ | 1031 | ret2 = ret1; \ |
1031 | } while (0) | 1032 | } while (0) |
1032 | 1033 | ||
1033 | TEST_EVENTS(test__events); | 1034 | TEST_EVENTS(test__events); |
@@ -1035,5 +1036,9 @@ do { \ | |||
1035 | if (test_pmu()) | 1036 | if (test_pmu()) |
1036 | TEST_EVENTS(test__events_pmu); | 1037 | TEST_EVENTS(test__events_pmu); |
1037 | 1038 | ||
1038 | return test_terms(test__terms, ARRAY_SIZE(test__terms)); | 1039 | ret1 = test_terms(test__terms, ARRAY_SIZE(test__terms)); |
1040 | if (!ret2) | ||
1041 | ret2 = ret1; | ||
1042 | |||
1043 | return ret2; | ||
1039 | } | 1044 | } |