summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/open-syscall.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2014-08-14 02:22:45 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-15 13:07:28 -0300
commitba3dfff8ad2d98df0c8116faaeb281c93e161636 (patch)
tree2fa417b3aebbe73297242806eedb7a28633cb87b /tools/perf/tests/open-syscall.c
parent35550da389ba8752f024a44ef14b74001c4fc4d3 (diff)
downloadop-kernel-dev-ba3dfff8ad2d98df0c8116faaeb281c93e161636.zip
op-kernel-dev-ba3dfff8ad2d98df0c8116faaeb281c93e161636.tar.gz
perf test: Use strerror_r instead of strerror
Use strerror_r instead of strerror in error messages for thread-safety. Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Naohiro Aota <naota@elisp.net> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20140814022245.3545.91394.stgit@kbuild-fedora.novalocal Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/open-syscall.c')
-rw-r--r--tools/perf/tests/open-syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/tests/open-syscall.c b/tools/perf/tests/open-syscall.c
index c1dc7d2..a33b2da 100644
--- a/tools/perf/tests/open-syscall.c
+++ b/tools/perf/tests/open-syscall.c
@@ -9,6 +9,7 @@ int test__open_syscall_event(void)
struct perf_evsel *evsel;
unsigned int nr_open_calls = 111, i;
struct thread_map *threads = thread_map__new(-1, getpid(), UINT_MAX);
+ char sbuf[STRERR_BUFSIZE];
if (threads == NULL) {
pr_debug("thread_map__new\n");
@@ -24,7 +25,7 @@ int test__open_syscall_event(void)
if (perf_evsel__open_per_thread(evsel, threads) < 0) {
pr_debug("failed to open counter: %s, "
"tweak /proc/sys/kernel/perf_event_paranoid?\n",
- strerror(errno));
+ strerror_r(errno, sbuf, sizeof(sbuf)));
goto out_evsel_delete;
}
OpenPOWER on IntegriCloud