aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r--tools/perf/builtin-test.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index d909eb74a0eb..2ea5fe4cc940 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -478,7 +478,6 @@ static int test__basic_mmap(void)
478 unsigned int nr_events[nsyscalls], 478 unsigned int nr_events[nsyscalls],
479 expected_nr_events[nsyscalls], i, j; 479 expected_nr_events[nsyscalls], i, j;
480 struct perf_evsel *evsels[nsyscalls], *evsel; 480 struct perf_evsel *evsels[nsyscalls], *evsel;
481 int sample_size = __perf_evsel__sample_size(attr.sample_type);
482 481
483 for (i = 0; i < nsyscalls; ++i) { 482 for (i = 0; i < nsyscalls; ++i) {
484 char name[64]; 483 char name[64];
@@ -563,7 +562,8 @@ static int test__basic_mmap(void)
563 goto out_munmap; 562 goto out_munmap;
564 } 563 }
565 564
566 err = perf_event__parse_sample(event, attr.sample_type, sample_size, 565 err = perf_event__parse_sample(event, attr.sample_type,
566 evsels[0]->sample_size,
567 false, &sample, false); 567 false, &sample, false);
568 if (err) { 568 if (err) {
569 pr_err("Can't parse sample, err = %d\n", err); 569 pr_err("Can't parse sample, err = %d\n", err);
@@ -666,7 +666,7 @@ static int test__PERF_RECORD(void)
666 found_libc_mmap = false, 666 found_libc_mmap = false,
667 found_vdso_mmap = false, 667 found_vdso_mmap = false,
668 found_ld_mmap = false; 668 found_ld_mmap = false;
669 int err = -1, errs = 0, i, wakeups = 0, sample_size; 669 int err = -1, errs = 0, i, wakeups = 0;
670 u32 cpu; 670 u32 cpu;
671 int total_events = 0, nr_events[PERF_RECORD_MAX] = { 0, }; 671 int total_events = 0, nr_events[PERF_RECORD_MAX] = { 0, };
672 672
@@ -761,7 +761,6 @@ static int test__PERF_RECORD(void)
761 * event. 761 * event.
762 */ 762 */
763 sample_type = perf_evlist__sample_type(evlist); 763 sample_type = perf_evlist__sample_type(evlist);
764 sample_size = __perf_evsel__sample_size(sample_type);
765 764
766 /* 765 /*
767 * Now that all is properly set up, enable the events, they will 766 * Now that all is properly set up, enable the events, they will
@@ -789,7 +788,7 @@ static int test__PERF_RECORD(void)
789 nr_events[type]++; 788 nr_events[type]++;
790 789
791 err = perf_event__parse_sample(event, sample_type, 790 err = perf_event__parse_sample(event, sample_type,
792 sample_size, true, 791 evsel->sample_size, true,
793 &sample, false); 792 &sample, false);
794 if (err < 0) { 793 if (err < 0) {
795 if (verbose) 794 if (verbose)