Commit f9f33fdb authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Arnaldo Carvalho de Melo

perf kvm: Use strerror_r instead of strerror

Use strerror_r instead of strerror in error messages for thread-safety.
Signed-off-by: default avatarMasami 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/20140814022251.3545.83718.stgit@kbuild-fedora.novalocalSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 340481ad
...@@ -990,6 +990,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm) ...@@ -990,6 +990,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
int err, rc = -1; int err, rc = -1;
struct perf_evsel *pos; struct perf_evsel *pos;
struct perf_evlist *evlist = kvm->evlist; struct perf_evlist *evlist = kvm->evlist;
char sbuf[STRERR_BUFSIZE];
perf_evlist__config(evlist, &kvm->opts); perf_evlist__config(evlist, &kvm->opts);
...@@ -1026,12 +1027,14 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm) ...@@ -1026,12 +1027,14 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
err = perf_evlist__open(evlist); err = perf_evlist__open(evlist);
if (err < 0) { if (err < 0) {
printf("Couldn't create the events: %s\n", strerror(errno)); printf("Couldn't create the events: %s\n",
strerror_r(errno, sbuf, sizeof(sbuf)));
goto out; goto out;
} }
if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages, false) < 0) { if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages, false) < 0) {
ui__error("Failed to mmap the events: %s\n", strerror(errno)); ui__error("Failed to mmap the events: %s\n",
strerror_r(errno, sbuf, sizeof(sbuf)));
perf_evlist__close(evlist); perf_evlist__close(evlist);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment