perf hist: Make event__totals per hists

This is one more thing that started global but are more useful per hist
or per session.

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>
This commit is contained in:
Arnaldo Carvalho de Melo
2010-05-14 10:36:42 -03:00
parent 5d2be7cb19
commit c8446b9bda
8 changed files with 62 additions and 38 deletions

View File

@@ -139,6 +139,12 @@ static int add_event_total(struct perf_session *session,
return -ENOMEM;
hists->stats.total += data->period;
/*
* FIXME: add_event_total should be moved from here to
* perf_session__process_event so that the proper hist is passed to
* the event_op methods.
*/
hists__inc_nr_events(hists, PERF_RECORD_SAMPLE);
session->hists.stats.total += data->period;
return 0;
}
@@ -293,7 +299,7 @@ static int __cmd_report(void)
goto out_delete;
if (dump_trace) {
event__print_totals();
perf_session__fprintf_nr_events(session, stdout);
goto out_delete;
}