summaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-07 17:46:24 +0200
committerIngo Molnar <mingo@elte.hu>2009-06-07 17:46:24 +0200
commit30c806a094493beb7691bc7957dfa02dee96230a (patch)
tree050253f0a69d5fab3cee07c07061e1468ac3c4f1 /tools/perf
parentperf record: Fall back to cpu-clock-ticks if no PMU (diff)
downloadlinux-30c806a094493beb7691bc7957dfa02dee96230a.tar.xz
linux-30c806a094493beb7691bc7957dfa02dee96230a.zip
perf_counter tools: Handle kernels with !CONFIG_PERF_COUNTER
If perf is run on a !CONFIG_PERF_COUNTER kernel right now it bails out with no messages or with confusing messages. Standardize this case some more and explain the situation. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c7
-rw-r--r--tools/perf/builtin-top.c8
2 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 87866294a0e6..deaee42d5eb0 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -356,9 +356,6 @@ try_again:
if (fd[nr_cpu][counter] < 0) {
int err = errno;
- if (verbose)
- error("sys_perf_counter_open() syscall returned with %d (%s)\n",
- fd[nr_cpu][counter], strerror(err));
if (err == EPERM)
die("Permission error - are you root?\n");
@@ -376,6 +373,10 @@ try_again:
attr->config = PERF_COUNT_CPU_CLOCK;
goto try_again;
}
+ printf("\n");
+ error("perfcounter syscall returned with %d (%s)\n",
+ fd[nr_cpu][counter], strerror(err));
+ die("No CONFIG_PERF_COUNTERS=y kernel support configured?\n");
exit(-1);
}
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1f8c97d5c32e..be1698f1189b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -551,10 +551,6 @@ try_again:
if (fd[i][counter] < 0) {
int err = errno;
- if (verbose)
- error("sys_perf_counter_open() syscall returned with %d (%s)\n",
- fd[i][counter], strerror(err));
-
if (err == EPERM)
die("No permission - are you root?\n");
/*
@@ -572,6 +568,10 @@ try_again:
attr->config = PERF_COUNT_CPU_CLOCK;
goto try_again;
}
+ printf("\n");
+ error("perfcounter syscall returned with %d (%s)\n",
+ fd[i][counter], strerror(err));
+ die("No CONFIG_PERF_COUNTERS=y kernel support configured?\n");
exit(-1);
}
assert(fd[i][counter] >= 0);