Messages in this thread Patch in this message | | | From | Alexander Shishkin <> | Subject | [PATCH RFC v3 6/6] perf tools: Use extended syscall error reporting | Date | Fri, 11 Sep 2015 19:00:05 +0300 |
| |
If the kernel has an extended error report for us, use it instead of trying to guess what might have gone wrong.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> --- tools/perf/util/evsel.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index c53f79123b..1804781072 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -27,6 +27,7 @@ #include "debug.h" #include "trace-event.h" #include "stat.h" +#include "exterr.h" static struct { bool sample_id_all; @@ -2266,7 +2267,16 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err, int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, int err, char *msg, size_t size) { - char sbuf[STRERR_BUFSIZE]; + char sbuf[BUFSIZ]; + int ret; + + ret = exterr__strerror(msg, size); + /* + * If kernel gave an extended error description, don't try to be any + * more helpful here. + */ + if (ret > 0) + return ret; switch (err) { case EPERM: -- 2.5.1
| |