diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-06-27 12:08:42 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-06-27 12:08:42 -0400 |
commit | da3789628f88684d3f0fb4e6a6bc086c395ac3cb (patch) | |
tree | f1573d6b2c8fa4e46f47c5558135a0a56d4397ef /tools/perf/util/session.h | |
parent | 7a25b2d32b9cb0b813d56ee6109acf90f3c9f1e5 (diff) |
perf tools: Stop using a global trace events description list
The pevent thing is per perf.data file, so I made it stop being static
and become a perf_session member, so tools processing perf.data files
use perf_session and _there_ we read the trace events description into
session->pevent and then change everywhere to stop using that single
global pevent variable and use the per session one.
Note that it _doesn't_ fall backs to trace__event_id, as we're not
interested at all in what is present in the
/sys/kernel/debug/tracing/events in the workstation doing the analysis,
just in what is in the perf.data file.
This patch also introduces perf_session__set_tracepoints_handlers that
is the perf perf.data/session way to associate handlers to tracepoint
events by resolving their IDs using the events descriptions stored in a
perf.data file. Make 'perf sched' use it.
Reported-by: Dmitry Antipov <dmitry.antipov@linaro.org>
Tested-by: Dmitry Antipov <dmitry.antipov@linaro.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linaro-dev@lists.linaro.org
Cc: patches@linaro.org
Link: http://lkml.kernel.org/r/20120625232016.GA28525@infradead.org
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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index c71a1a7b05ed..7c435bde6eb0 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -33,6 +33,7 @@ struct perf_session { | |||
33 | struct machine host_machine; | 33 | struct machine host_machine; |
34 | struct rb_root machines; | 34 | struct rb_root machines; |
35 | struct perf_evlist *evlist; | 35 | struct perf_evlist *evlist; |
36 | struct pevent *pevent; | ||
36 | /* | 37 | /* |
37 | * FIXME: Need to split this up further, we need global | 38 | * FIXME: Need to split this up further, we need global |
38 | * stats + per event stats. 'perf diff' also needs | 39 | * stats + per event stats. 'perf diff' also needs |
@@ -158,4 +159,13 @@ int perf_session__cpu_bitmap(struct perf_session *session, | |||
158 | const char *cpu_list, unsigned long *cpu_bitmap); | 159 | const char *cpu_list, unsigned long *cpu_bitmap); |
159 | 160 | ||
160 | void perf_session__fprintf_info(struct perf_session *s, FILE *fp, bool full); | 161 | void perf_session__fprintf_info(struct perf_session *s, FILE *fp, bool full); |
162 | |||
163 | struct perf_evsel_str_handler; | ||
164 | |||
165 | int __perf_session__set_tracepoints_handlers(struct perf_session *session, | ||
166 | const struct perf_evsel_str_handler *assocs, | ||
167 | size_t nr_assocs); | ||
168 | |||
169 | #define perf_session__set_tracepoints_handlers(session, array) \ | ||
170 | __perf_session__set_tracepoints_handlers(session, array, ARRAY_SIZE(array)) | ||
161 | #endif /* __PERF_SESSION_H */ | 171 | #endif /* __PERF_SESSION_H */ |