diff options
Diffstat (limited to 'tools/perf/builtin-stat.c')
| -rw-r--r-- | tools/perf/builtin-stat.c | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1f19f2f999c8..e459b685a4e9 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -298,6 +298,14 @@ static int read_counter(struct perf_evsel *counter)  					return -1;  				}  			} + +			if (verbose > 1) { +				fprintf(stat_config.output, +					"%s: %d: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", +						perf_evsel__name(counter), +						cpu, +						count->val, count->ena, count->run); +			}  		}  	} @@ -528,6 +536,7 @@ static int __run_perf_stat(int argc, const char **argv)  		perf_evlist__set_leader(evsel_list);  	evlist__for_each(evsel_list, counter) { +try_again:  		if (create_perf_stat_counter(counter) < 0) {  			/*  			 * PPC returns ENXIO for HW counters until 2.6.37 @@ -544,7 +553,11 @@ static int __run_perf_stat(int argc, const char **argv)  				if ((counter->leader != counter) ||  				    !(counter->leader->nr_members > 1))  					continue; -			} +			} else if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) { +                                if (verbose) +                                        ui__warning("%s\n", msg); +                                goto try_again; +                        }  			perf_evsel__open_strerror(counter, &target,  						  errno, msg, sizeof(msg));  |