public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record: Change error message on failure
@ 2012-09-13 10:20 Robert Richter
  2012-09-13 15:07 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Richter @ 2012-09-13 10:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, linux-kernel, Robert Richter

Only report

 No CONFIG_PERF_EVENTS=y kernel support configured?

if the syscall fails with ENOSYS. In other cases CONFIG_PERF_EVENTS is
set and might confuse users. The default message is now:

 Not all events could be opened.

Signed-off-by: Robert Richter <robert.richter@amd.com>
---
 tools/perf/builtin-record.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index ae7c1c9..0290c91 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -305,19 +305,19 @@ try_again:
 			error("sys_perf_event_open() syscall returned with %d (%s).  /bin/dmesg may provide additional information.\n",
 			      err, strerror(err));
 
+			if (err == ENOSYS)
+				pr_err("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
 #if defined(__i386__) || defined(__x86_64__)
-			if (attr->type == PERF_TYPE_HARDWARE &&
-			    err == EOPNOTSUPP) {
+			else if (attr->type == PERF_TYPE_HARDWARE &&
+				 err == EOPNOTSUPP)
 				pr_err("No hardware sampling interrupt available."
 				       " No APIC? If so then you can boot the kernel"
 				       " with the \"lapic\" boot parameter to"
 				       " force-enable it.\n");
-				rc = -err;
-				goto out;
-			}
 #endif
+			else
+				pr_err("Not all events could be opened.\n");
 
-			pr_err("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
 			rc = -err;
 			goto out;
 		}
-- 
1.7.8.6



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-13 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-13 10:20 [PATCH] perf record: Change error message on failure Robert Richter
2012-09-13 15:07 ` Ingo Molnar
2012-09-13 15:21   ` Robert Richter
2012-09-13 15:25     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox