Skip to contentSkip to conversation

perf stat: tell user about unsupported events in the list

PATCH In review David Ahern 1 participant 2 messages Apr 29, 2011 – Apr 30, 2011 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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':

<not counted> dTLB-prefetch-misses

1.001884783 seconds time elapsed

---
 tools/perf/builtin-stat.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
tools/perf/builtin-stat.c +5 -1
index c8b535b..602c3c9 100644
@@ -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"
Signature · 1 line
1.7.4.4
#1 lore raw

[tip:perf/stat] perf stat: Tell user about unsupported events in the list

Commit-ID:  c63ca0c01d73563d4e2ab174bb3dd1e5efb907e6
Gitweb:     http://git.kernel.org/tip/c63ca0c01d73563d4e2ab174bb3dd1e5efb907e6
Author:     David Ahern <[email protected]>
AuthorDate: Fri, 29 Apr 2011 16:04:15 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 30 Apr 2011 00:18:14 +0200

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':

<not counted> dTLB-prefetch-misses

1.001884783 seconds time elapsed

---
 tools/perf/builtin-stat.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
tools/perf/builtin-stat.c +5 -1
index c8b535b..602c3c9 100644
@@ -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"