diff options
Diffstat (limited to 'tools/perf/tests/sw-clock.c')
-rw-r--r-- | tools/perf/tests/sw-clock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 983d6b8562a8..1aa21c90731b 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c | |||
@@ -22,6 +22,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
22 | volatile int tmp = 0; | 22 | volatile int tmp = 0; |
23 | u64 total_periods = 0; | 23 | u64 total_periods = 0; |
24 | int nr_samples = 0; | 24 | int nr_samples = 0; |
25 | char sbuf[STRERR_BUFSIZE]; | ||
25 | union perf_event *event; | 26 | union perf_event *event; |
26 | struct perf_evsel *evsel; | 27 | struct perf_evsel *evsel; |
27 | struct perf_evlist *evlist; | 28 | struct perf_evlist *evlist; |
@@ -62,14 +63,15 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
62 | 63 | ||
63 | err = -errno; | 64 | err = -errno; |
64 | pr_debug("Couldn't open evlist: %s\nHint: check %s, using %" PRIu64 " in this test.\n", | 65 | pr_debug("Couldn't open evlist: %s\nHint: check %s, using %" PRIu64 " in this test.\n", |
65 | strerror(errno), knob, (u64)attr.sample_freq); | 66 | strerror_r(errno, sbuf, sizeof(sbuf)), |
67 | knob, (u64)attr.sample_freq); | ||
66 | goto out_delete_evlist; | 68 | goto out_delete_evlist; |
67 | } | 69 | } |
68 | 70 | ||
69 | err = perf_evlist__mmap(evlist, 128, true); | 71 | err = perf_evlist__mmap(evlist, 128, true); |
70 | if (err < 0) { | 72 | if (err < 0) { |
71 | pr_debug("failed to mmap event: %d (%s)\n", errno, | 73 | pr_debug("failed to mmap event: %d (%s)\n", errno, |
72 | strerror(errno)); | 74 | strerror_r(errno, sbuf, sizeof(sbuf))); |
73 | goto out_delete_evlist; | 75 | goto out_delete_evlist; |
74 | } | 76 | } |
75 | 77 | ||