lkml.org 
[lkml]   [2015]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC v3 6/6] perf tools: Use extended syscall error reporting
Date
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


\
 
 \ /
  Last update: 2015-09-11 18:21    [W:0.119 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site