* [PATCH] perf stat: tell user about unsupported events in the list
@ 2011-04-29 22:04 David Ahern
0 siblings, 0 replies; only message in thread
From: David Ahern @ 2011-04-29 22:04 UTC (permalink / raw)
To: linux-perf-users, linux-kernel; +Cc: acme, mingo, David Ahern
Similar to perf-record, tell user about unsupported events
that will not be counted if invoked in verbose mode.
e.g.,
perf stat -e dTLB-prefetch-misses -v -- sleep 1
dTLB-prefetch-misses event is not supported by the kernel.
dTLB-prefetch-misses: 0 0 0
Performance counter stats for 'sleep 1':
<not counted> dTLB-prefetch-misses
1.001884783 seconds time elapsed
Signed-off-by: David Ahern <dsahern@gmail.com>
---
tools/perf/builtin-stat.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index c8b535b..602c3c9 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -377,8 +377,12 @@ static int run_perf_stat(int argc __used, const char **argv)
list_for_each_entry(counter, &evsel_list->entries, node) {
if (create_perf_stat_counter(counter) < 0) {
- if (errno == EINVAL || errno == ENOSYS || errno == ENOENT)
+ if (errno == EINVAL || errno == ENOSYS || errno == ENOENT) {
+ if (verbose)
+ ui__warning("%s event is not supported by the kernel.\n",
+ event_name(counter));
continue;
+ }
if (errno == EPERM || errno == EACCES) {
error("You may not have permission to collect %sstats.\n"
--
1.7.4.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-04-29 22:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-29 22:04 [PATCH] perf stat: tell user about unsupported events in the list David Ahern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).