From: Stephane Eranian Date: Thu, 20 Sep 2012 16:19:45 +0000 (+0200) Subject: perf record: Print event causing perf_event_open() to fail X-Git-Tag: upstream/snapshot3+hdmi~6017^2~45^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1863fbbb781b1129da0cfdad46ef875370a34117;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git perf record: Print event causing perf_event_open() to fail Got tired of not getting the event that caused the perf_event_open() syscall to fail. So I fixed the error message. This is very useful when monitoring lots of events in a single run. Signed-off-by: Stephane Eranian Cc: David Ahern Cc: Ingo Molnar Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20120920161945.GA7064@quad Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index c643ed6..2cb7434 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -297,8 +297,10 @@ try_again: } printf("\n"); - error("sys_perf_event_open() syscall returned with %d (%s). /bin/dmesg may provide additional information.\n", - err, strerror(err)); + error("sys_perf_event_open() syscall returned with %d " + "(%s) for event %s. /bin/dmesg may provide " + "additional information.\n", + err, strerror(err), perf_evsel__name(pos)); #if defined(__i386__) || defined(__x86_64__) if (attr->type == PERF_TYPE_HARDWARE &&