[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1347531654-16024-1-git-send-email-robert.richter@amd.com>
Date: Thu, 13 Sep 2012 12:20:54 +0200
From: Robert Richter <robert.richter@....com>
To: Arnaldo Carvalho de Melo <acme@...hat.com>
CC: Ingo Molnar <mingo@...nel.org>, <linux-kernel@...r.kernel.org>,
Robert Richter <robert.richter@....com>
Subject: [PATCH] perf record: Change error message on failure
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@....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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists