diff options
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r-- | tools/perf/util/session.h | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index decd83f274fd..b5b148b0aaca 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -34,12 +34,12 @@ struct perf_session { | |||
34 | struct thread *last_match; | 34 | struct thread *last_match; |
35 | struct machine host_machine; | 35 | struct machine host_machine; |
36 | struct rb_root machines; | 36 | struct rb_root machines; |
37 | struct rb_root hists_tree; | 37 | struct perf_evlist *evlist; |
38 | /* | 38 | /* |
39 | * FIXME: should point to the first entry in hists_tree and | 39 | * FIXME: Need to split this up further, we need global |
40 | * be a hists instance. Right now its only 'report' | 40 | * stats + per event stats. 'perf diff' also needs |
41 | * that is using ->hists_tree while all the rest use | 41 | * to properly support multiple events in a single |
42 | * ->hists. | 42 | * perf.data file. |
43 | */ | 43 | */ |
44 | struct hists hists; | 44 | struct hists hists; |
45 | u64 sample_type; | 45 | u64 sample_type; |
@@ -51,15 +51,17 @@ struct perf_session { | |||
51 | int cwdlen; | 51 | int cwdlen; |
52 | char *cwd; | 52 | char *cwd; |
53 | struct ordered_samples ordered_samples; | 53 | struct ordered_samples ordered_samples; |
54 | char filename[0]; | 54 | struct callchain_cursor callchain_cursor; |
55 | char filename[0]; | ||
55 | }; | 56 | }; |
56 | 57 | ||
57 | struct perf_event_ops; | 58 | struct perf_event_ops; |
58 | 59 | ||
59 | typedef int (*event_op)(event_t *self, struct sample_data *sample, | 60 | typedef int (*event_op)(union perf_event *self, struct perf_sample *sample, |
60 | struct perf_session *session); | 61 | struct perf_session *session); |
61 | typedef int (*event_synth_op)(event_t *self, struct perf_session *session); | 62 | typedef int (*event_synth_op)(union perf_event *self, |
62 | typedef int (*event_op2)(event_t *self, struct perf_session *session, | 63 | struct perf_session *session); |
64 | typedef int (*event_op2)(union perf_event *self, struct perf_session *session, | ||
63 | struct perf_event_ops *ops); | 65 | struct perf_event_ops *ops); |
64 | 66 | ||
65 | struct perf_event_ops { | 67 | struct perf_event_ops { |
@@ -94,10 +96,10 @@ int __perf_session__process_events(struct perf_session *self, | |||
94 | int perf_session__process_events(struct perf_session *self, | 96 | int perf_session__process_events(struct perf_session *self, |
95 | struct perf_event_ops *event_ops); | 97 | struct perf_event_ops *event_ops); |
96 | 98 | ||
97 | struct map_symbol *perf_session__resolve_callchain(struct perf_session *self, | 99 | int perf_session__resolve_callchain(struct perf_session *self, |
98 | struct thread *thread, | 100 | struct thread *thread, |
99 | struct ip_callchain *chain, | 101 | struct ip_callchain *chain, |
100 | struct symbol **parent); | 102 | struct symbol **parent); |
101 | 103 | ||
102 | bool perf_session__has_traces(struct perf_session *self, const char *msg); | 104 | bool perf_session__has_traces(struct perf_session *self, const char *msg); |
103 | 105 | ||
@@ -110,8 +112,6 @@ void mem_bswap_64(void *src, int byte_size); | |||
110 | int perf_session__create_kernel_maps(struct perf_session *self); | 112 | int perf_session__create_kernel_maps(struct perf_session *self); |
111 | 113 | ||
112 | void perf_session__update_sample_type(struct perf_session *self); | 114 | void perf_session__update_sample_type(struct perf_session *self); |
113 | void perf_session__set_sample_id_all(struct perf_session *session, bool value); | ||
114 | void perf_session__set_sample_type(struct perf_session *session, u64 type); | ||
115 | void perf_session__remove_thread(struct perf_session *self, struct thread *th); | 115 | void perf_session__remove_thread(struct perf_session *self, struct thread *th); |
116 | 116 | ||
117 | static inline | 117 | static inline |
@@ -149,9 +149,14 @@ size_t perf_session__fprintf_dsos(struct perf_session *self, FILE *fp); | |||
149 | size_t perf_session__fprintf_dsos_buildid(struct perf_session *self, | 149 | size_t perf_session__fprintf_dsos_buildid(struct perf_session *self, |
150 | FILE *fp, bool with_hits); | 150 | FILE *fp, bool with_hits); |
151 | 151 | ||
152 | static inline | 152 | size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp); |
153 | size_t perf_session__fprintf_nr_events(struct perf_session *self, FILE *fp) | 153 | |
154 | static inline int perf_session__parse_sample(struct perf_session *session, | ||
155 | const union perf_event *event, | ||
156 | struct perf_sample *sample) | ||
154 | { | 157 | { |
155 | return hists__fprintf_nr_events(&self->hists, fp); | 158 | return perf_event__parse_sample(event, session->sample_type, |
159 | session->sample_id_all, sample); | ||
156 | } | 160 | } |
161 | |||
157 | #endif /* __PERF_SESSION_H */ | 162 | #endif /* __PERF_SESSION_H */ |