summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-10 18:04:11 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-10 18:13:49 +0200
commit1c02c4d2e92f2097f1bba63ec71560b0e05a7f36 (patch)
treead2a722931398ce3cd3ae850c4cfa148558a52ea /tools/perf/util/session.h
parentperf session: create_kernel_maps should use ->host_machine (diff)
downloadlinux-1c02c4d2e92f2097f1bba63ec71560b0e05a7f36.tar.xz
linux-1c02c4d2e92f2097f1bba63ec71560b0e05a7f36.zip
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.h12
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 @@
#ifndef __PERF_SESSION_H
#define __PERF_SESSION_H
+#include "hist.h"
#include "event.h"
#include "header.h"
#include "symbol.h"
@@ -28,11 +29,16 @@ struct perf_session {
struct thread *last_match;
struct machine host_machine;
struct rb_root machines;
- struct events_stats events_stats;
- struct rb_root stats_by_id;
+ struct rb_root hists_tree;
unsigned long event_total[PERF_RECORD_MAX];
unsigned long unknown_events;
- struct rb_root hists;
+ /*
+ * FIXME: should point to the first entry in hists_tree and
+ * be a hists instance. Right now its only 'report'
+ * that is using ->hists_tree while all the rest use
+ * ->hists.
+ */
+ struct hists hists;
u64 sample_type;
int fd;
bool fd_pipe;