path: root/tools/perf/builtin-report.c
diff options
authorAshay Rane <ashay.rane@tacc.utexas.edu>2012-04-05 21:01:01 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-07 17:29:41 -0300
commitcc68628096b813010f30f69fcf7d1832d18fa767 (patch)
treeb21bcd709fdf69d127cb34005d6ec20b2df9fb62 /tools/perf/builtin-report.c
parentperf annotate browser: Initial support for navigating jump instructions (diff)
perf report: Correct display of samples and events in header
This patch prints the number of samples and the count of performance events separately. This allows comparing performance of different applications with each other. Previously, the sample count was displayed against an 'Events:' heading. With this patch, the header now reads (for example): Samples: 5K of event 'instructions' Event count (approx.): 2993026545 The patch covers both the stdio and the browser interface. Signed-off-by: Ashay Rane <ashay.rane@tacc.utexas.edu> [ committer note: Fixed wrt e7f01d1 ] Link: http://lkml.kernel.org/n/tip-h4nfjm8msedlk8gxkzivfh5y@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2e317438980b..cec2b8cee80c 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -296,12 +296,15 @@ static size_t hists__fprintf_nr_sample_events(struct hists *self,
size_t ret;
char unit;
- unsigned long nr_events = self->stats.nr_events[PERF_RECORD_SAMPLE];
+ unsigned long nr_samples = self->stats.nr_events[PERF_RECORD_SAMPLE];
+ u64 nr_events = self->stats.total_period;
- nr_events = convert_unit(nr_events, &unit);
- ret = fprintf(fp, "# Events: %lu%c", nr_events, unit);
+ nr_samples = convert_unit(nr_samples, &unit);
+ ret = fprintf(fp, "# Samples: %lu%c", nr_samples, unit);
if (evname != NULL)
- ret += fprintf(fp, " %s", evname);
+ ret += fprintf(fp, " of event '%s'", evname);
+ ret += fprintf(fp, "\n# Event count (approx.): %lu", nr_events);
return ret + fprintf(fp, "\n#\n");