aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/newt.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-14 13:19:35 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-14 13:19:35 -0400
commitc82ee828aa20487d254a5225d256cd422acee459 (patch)
tree6f8132442237bc4f2393e04a5f30b3711a8f91ca /tools/perf/util/newt.c
parentcee75ac7ecc27084accdb9d9d6fde65a09f047ae (diff)
perf report: Report number of events, not samples
Number of samples is meaningless after we switched to auto-freq, so report the number of events, i.e. not the sum of the different periods, but the number PERF_RECORD_SAMPLE emitted by the kernel. While doing this I noticed that naming "count" to the sum of all the event periods can be confusing, so rename it to .period, just like in struct sample.data, so that we become more consistent. This helps with the next step, that was to record in struct hist_entry the number of sample events for each instance, we need that because we use it to generate the number of events when applying filters to the tree of hist entries like it is being done in the TUI report browser. Suggested-by: Ingo Molnar <mingo@elte.hu> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/newt.c')
-rw-r--r--tools/perf/util/newt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 010bacf40163..3402453812b3 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -680,16 +680,18 @@ static int hist_browser__populate(struct hist_browser *self, struct hists *hists
680 struct ui_progress *progress; 680 struct ui_progress *progress;
681 struct rb_node *nd; 681 struct rb_node *nd;
682 u64 curr_hist = 0; 682 u64 curr_hist = 0;
683 char seq[] = "."; 683 char seq[] = ".", unit;
684 char str[256]; 684 char str[256];
685 unsigned long nr_events = hists->stats.nr_events[PERF_RECORD_SAMPLE];
685 686
686 if (self->form) { 687 if (self->form) {
687 newtFormDestroy(self->form); 688 newtFormDestroy(self->form);
688 newtPopWindow(); 689 newtPopWindow();
689 } 690 }
690 691
691 snprintf(str, sizeof(str), "Samples: %Ld ", 692 nr_events = convert_unit(nr_events, &unit);
692 hists->stats.total_period); 693 snprintf(str, sizeof(str), "Events: %lu%c ",
694 nr_events, unit);
693 newtDrawRootText(0, 0, str); 695 newtDrawRootText(0, 0, str);
694 696
695 newtGetScreenSize(NULL, &rows); 697 newtGetScreenSize(NULL, &rows);