* [PATCH] perf top: error handling for counter creation should parallel perf-record
@ 2012-07-30 2:53 David Ahern
2012-08-05 16:52 ` [tip:perf/urgent] perf top: Error " tip-bot for David Ahern
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2012-07-30 2:53 UTC (permalink / raw)
To: acme, linux-kernel
Cc: David Ahern, Ingo Molnar, Jiri Olsa, Namhyung Kim,
Frederic Weisbecker, Peter Zijlstra, Robert Richter
5a7ed29 fixed up perf-record but not perf-top. Similar argument
holds for it -- fallback to PMU only if it does not exist and handle
invalid attributes separately.
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
---
tools/perf/builtin-top.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 35e86c6..534ac3a 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -943,8 +943,10 @@ try_again:
* based cpu-clock-tick sw counter, which
* is always available even if no PMU support:
*/
- if (attr->type == PERF_TYPE_HARDWARE &&
- attr->config == PERF_COUNT_HW_CPU_CYCLES) {
+ if ((err == ENOENT || err == ENXIO) &&
+ (attr->type == PERF_TYPE_HARDWARE) &&
+ (attr->config == PERF_COUNT_HW_CPU_CYCLES)) {
+
if (verbose)
ui__warning("Cycles event not supported,\n"
"trying to fall back to cpu-clock-ticks\n");
--
1.7.10.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:perf/urgent] perf top: Error handling for counter creation should parallel perf-record
2012-07-30 2:53 [PATCH] perf top: error handling for counter creation should parallel perf-record David Ahern
@ 2012-08-05 16:52 ` tip-bot for David Ahern
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for David Ahern @ 2012-08-05 16:52 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, peterz, namhyung, jolsa, fweisbec,
robert.richter, dsahern, tglx
Commit-ID: 1a31fc904f1c897e4aaf7c3176e6aafa49f5d395
Gitweb: http://git.kernel.org/tip/1a31fc904f1c897e4aaf7c3176e6aafa49f5d395
Author: David Ahern <dsahern@gmail.com>
AuthorDate: Sun, 29 Jul 2012 20:53:03 -0600
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 3 Aug 2012 10:30:18 -0300
perf top: Error handling for counter creation should parallel perf-record
5a7ed29 fixed up perf-record but not perf-top. Similar argument holds
for it -- fallback to PMU only if it does not exist and handle invalid
attributes separately.
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
Link: http://lkml.kernel.org/r/1343616783-6360-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-top.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 40264ea..3409627 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -943,8 +943,10 @@ try_again:
* based cpu-clock-tick sw counter, which
* is always available even if no PMU support:
*/
- if (attr->type == PERF_TYPE_HARDWARE &&
- attr->config == PERF_COUNT_HW_CPU_CYCLES) {
+ if ((err == ENOENT || err == ENXIO) &&
+ (attr->type == PERF_TYPE_HARDWARE) &&
+ (attr->config == PERF_COUNT_HW_CPU_CYCLES)) {
+
if (verbose)
ui__warning("Cycles event not supported,\n"
"trying to fall back to cpu-clock-ticks\n");
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-05 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 2:53 [PATCH] perf top: error handling for counter creation should parallel perf-record David Ahern
2012-08-05 16:52 ` [tip:perf/urgent] perf top: Error " tip-bot for David Ahern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox