aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/ui/browsers/hists.c
diff options
context:
space:
mode:
authorAshay Rane <ashay.rane@tacc.utexas.edu>2012-04-05 22:01:01 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-07 16:29:41 -0400
commitcc68628096b813010f30f69fcf7d1832d18fa767 (patch)
treeb21bcd709fdf69d127cb34005d6ec20b2df9fb62 /tools/perf/util/ui/browsers/hists.c
parent08be4eeda40ea813fa326036fdaf8fa7667eb021 (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/util/ui/browsers/hists.c')
-rw-r--r--tools/perf/util/ui/browsers/hists.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 2f83e5dc996..1b820ed2a04 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -840,10 +840,14 @@ static int hists__browser_title(struct hists *self, char *bf, size_t size,
840 int printed; 840 int printed;
841 const struct dso *dso = self->dso_filter; 841 const struct dso *dso = self->dso_filter;
842 const struct thread *thread = self->thread_filter; 842 const struct thread *thread = self->thread_filter;
843 unsigned long nr_events = self->stats.nr_events[PERF_RECORD_SAMPLE]; 843 unsigned long nr_samples = self->stats.nr_events[PERF_RECORD_SAMPLE];
844 u64 nr_events = self->stats.total_period;
845
846 nr_samples = convert_unit(nr_samples, &unit);
847 printed = scnprintf(bf, size,
848 "Samples: %lu%c of event '%s', Event count (approx.): %lu",
849 nr_samples, unit, ev_name, nr_events);
844 850
845 nr_events = convert_unit(nr_events, &unit);
846 printed = scnprintf(bf, size, "Events: %lu%c %s", nr_events, unit, ev_name);
847 851
848 if (self->uid_filter_str) 852 if (self->uid_filter_str)
849 printed += snprintf(bf + printed, size - printed, 853 printed += snprintf(bf + printed, size - printed,