lkml.org 
[lkml]   [2012]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf record: Change error message on failure
Date
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



\
 
 \ /
  Last update: 2012-09-13 13:41    [W:2.233 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site