aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2012-07-29 22:53:03 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-08-03 09:30:18 -0400
commit1a31fc904f1c897e4aaf7c3176e6aafa49f5d395 (patch)
tree10b7ae8bb5af31a4be085d6e1c91e6f0d7875dc8 /tools/perf
parent7405ed10f6adcdd556d59c360b5b216fccada3d9 (diff)
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>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-top.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 40264eaa9f0f..34096275a7b5 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -943,8 +943,10 @@ try_again:
943 * based cpu-clock-tick sw counter, which 943 * based cpu-clock-tick sw counter, which
944 * is always available even if no PMU support: 944 * is always available even if no PMU support:
945 */ 945 */
946 if (attr->type == PERF_TYPE_HARDWARE && 946 if ((err == ENOENT || err == ENXIO) &&
947 attr->config == PERF_COUNT_HW_CPU_CYCLES) { 947 (attr->type == PERF_TYPE_HARDWARE) &&
948 (attr->config == PERF_COUNT_HW_CPU_CYCLES)) {
949
948 if (verbose) 950 if (verbose)
949 ui__warning("Cycles event not supported,\n" 951 ui__warning("Cycles event not supported,\n"
950 "trying to fall back to cpu-clock-ticks\n"); 952 "trying to fall back to cpu-clock-ticks\n");