From: David Ahern Date: Fri, 29 Apr 2011 22:04:15 +0000 (-0600) Subject: perf stat: Tell user about unsupported events in the list X-Git-Tag: MMI-PSA29.97-13-9~19718^2~11^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c63ca0c01d73563d4e2ab174bb3dd1e5efb907e6;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git perf stat: Tell user about unsupported events in the list 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': dTLB-prefetch-misses 1.001884783 seconds time elapsed Signed-off-by: David Ahern Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker Link: http://lkml.kernel.org/r/1304114655-10600-1-git-send-email-dsahern@gmail.com Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c8b535bc27bd..602c3c96fa1e 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"