diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-05-10 12:04:11 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-05-10 12:13:49 -0400 |
commit | 1c02c4d2e92f2097f1bba63ec71560b0e05a7f36 (patch) | |
tree | ad2a722931398ce3cd3ae850c4cfa148558a52ea /tools/perf/util/session.h | |
parent | d118f8ba6ac2af2bf11d40cba657c813f0f39ca2 (diff) |
perf hist: Introduce hists class and move lots of methods to it
In cbbc79a we introduced support for multiple events by introducing a
new "event_stat_id" struct and then made several perf_session methods
receive a point to it instead of a pointer to perf_session, and kept the
event_stats and hists rb_tree in perf_session.
While working on the new newt based browser, I realised that it would be
better to introduce a new class, "hists" (short for "histograms"),
renaming the "event_stat_id" struct and the perf_session methods that
were really "hists" methods, as they manipulate only struct hists
members, not touching anything in the other perf_session members.
Other optimizations, such as calculating the maximum lenght of a symbol
name present in an hists instance will be possible as we add them,
avoiding a re-traversal just for finding that information.
The rationale for the name "hists" to replace "event_stat_id" is that we
may have multiple sets of hists for the same event_stat id, as, for
instance, the 'perf diff' tool has, so event stat id is not what
characterizes what this struct and the functions that manipulate it do.
Cc: Eric B Munson <ebmunson@us.ibm.com>
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/session.h')
-rw-r--r-- | tools/perf/util/session.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 242d528bfae2..46190f94b547 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __PERF_SESSION_H | 1 | #ifndef __PERF_SESSION_H |
2 | #define __PERF_SESSION_H | 2 | #define __PERF_SESSION_H |
3 | 3 | ||
4 | #include "hist.h" | ||
4 | #include "event.h" | 5 | #include "event.h" |
5 | #include "header.h" | 6 | #include "header.h" |
6 | #include "symbol.h" | 7 | #include "symbol.h" |
@@ -28,11 +29,16 @@ struct perf_session { | |||
28 | struct thread *last_match; | 29 | struct thread *last_match; |
29 | struct machine host_machine; | 30 | struct machine host_machine; |
30 | struct rb_root machines; | 31 | struct rb_root machines; |
31 | struct events_stats events_stats; | 32 | struct rb_root hists_tree; |
32 | struct rb_root stats_by_id; | ||
33 | unsigned long event_total[PERF_RECORD_MAX]; | 33 | unsigned long event_total[PERF_RECORD_MAX]; |
34 | unsigned long unknown_events; | 34 | unsigned long unknown_events; |
35 | struct rb_root hists; | 35 | /* |
36 | * FIXME: should point to the first entry in hists_tree and | ||
37 | * be a hists instance. Right now its only 'report' | ||
38 | * that is using ->hists_tree while all the rest use | ||
39 | * ->hists. | ||
40 | */ | ||
41 | struct hists hists; | ||
36 | u64 sample_type; | 42 | u64 sample_type; |
37 | int fd; | 43 | int fd; |
38 | bool fd_pipe; | 44 | bool fd_pipe; |