[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-30c806a094493beb7691bc7957dfa02dee96230a@git.kernel.org>
Date: Sun, 7 Jun 2009 15:51:32 GMT
From: tip-bot for Ingo Molnar <mingo@...e.hu>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
efault@....de, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perfcounters/core] perf_counter tools: Handle kernels with !CONFIG_PERF_COUNTER
Commit-ID: 30c806a094493beb7691bc7957dfa02dee96230a
Gitweb: http://git.kernel.org/tip/30c806a094493beb7691bc7957dfa02dee96230a
Author: Ingo Molnar <mingo@...e.hu>
AuthorDate: Sun, 7 Jun 2009 17:46:24 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Sun, 7 Jun 2009 17:46:24 +0200
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@...llo.nl>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
tools/perf/builtin-record.c | 7 ++++---
tools/perf/builtin-top.c | 8 ++++----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 8786629..deaee42 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 1f8c97d..be1698f 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);
--
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