From 4542a949d6f44295842a91735abc1f5fbb040452 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Sun, 29 Jul 2012 20:53:03 -0600 Subject: [PATCH] --- yaml --- r: 321416 b: refs/heads/master c: 1a31fc904f1c897e4aaf7c3176e6aafa49f5d395 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-top.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index c73f5a3891b3..6ac2c4558b6b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7405ed10f6adcdd556d59c360b5b216fccada3d9 +refs/heads/master: 1a31fc904f1c897e4aaf7c3176e6aafa49f5d395 diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c index 40264eaa9f0f..34096275a7b5 100644 --- a/trunk/tools/perf/builtin-top.c +++ b/trunk/tools/perf/builtin-top.c @@ -943,8 +943,10 @@ static void perf_top__start_counters(struct perf_top *top) * 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");