diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /tools/perf/util/event.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r-- | tools/perf/util/event.h | 82 |
1 files changed, 53 insertions, 29 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 8e790dae7026..1d7f66488a88 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -56,12 +56,19 @@ struct read_event { | |||
56 | u64 id; | 56 | u64 id; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | |||
60 | #define PERF_SAMPLE_MASK \ | ||
61 | (PERF_SAMPLE_IP | PERF_SAMPLE_TID | \ | ||
62 | PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR | \ | ||
63 | PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID | \ | ||
64 | PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) | ||
65 | |||
59 | struct sample_event { | 66 | struct sample_event { |
60 | struct perf_event_header header; | 67 | struct perf_event_header header; |
61 | u64 array[]; | 68 | u64 array[]; |
62 | }; | 69 | }; |
63 | 70 | ||
64 | struct sample_data { | 71 | struct perf_sample { |
65 | u64 ip; | 72 | u64 ip; |
66 | u32 pid, tid; | 73 | u32 pid, tid; |
67 | u64 time; | 74 | u64 time; |
@@ -85,6 +92,7 @@ struct build_id_event { | |||
85 | }; | 92 | }; |
86 | 93 | ||
87 | enum perf_user_event_type { /* above any possible kernel type */ | 94 | enum perf_user_event_type { /* above any possible kernel type */ |
95 | PERF_RECORD_USER_TYPE_START = 64, | ||
88 | PERF_RECORD_HEADER_ATTR = 64, | 96 | PERF_RECORD_HEADER_ATTR = 64, |
89 | PERF_RECORD_HEADER_EVENT_TYPE = 65, | 97 | PERF_RECORD_HEADER_EVENT_TYPE = 65, |
90 | PERF_RECORD_HEADER_TRACING_DATA = 66, | 98 | PERF_RECORD_HEADER_TRACING_DATA = 66, |
@@ -116,7 +124,7 @@ struct tracing_data_event { | |||
116 | u32 size; | 124 | u32 size; |
117 | }; | 125 | }; |
118 | 126 | ||
119 | typedef union event_union { | 127 | union perf_event { |
120 | struct perf_event_header header; | 128 | struct perf_event_header header; |
121 | struct ip_event ip; | 129 | struct ip_event ip; |
122 | struct mmap_event mmap; | 130 | struct mmap_event mmap; |
@@ -129,39 +137,55 @@ typedef union event_union { | |||
129 | struct event_type_event event_type; | 137 | struct event_type_event event_type; |
130 | struct tracing_data_event tracing_data; | 138 | struct tracing_data_event tracing_data; |
131 | struct build_id_event build_id; | 139 | struct build_id_event build_id; |
132 | } event_t; | 140 | }; |
133 | 141 | ||
134 | void event__print_totals(void); | 142 | void perf_event__print_totals(void); |
135 | 143 | ||
136 | struct perf_session; | 144 | struct perf_session; |
137 | 145 | struct thread_map; | |
138 | typedef int (*event__handler_t)(event_t *event, struct perf_session *session); | 146 | |
139 | 147 | typedef int (*perf_event__handler_synth_t)(union perf_event *event, | |
140 | int event__synthesize_thread(pid_t pid, event__handler_t process, | 148 | struct perf_session *session); |
149 | typedef int (*perf_event__handler_t)(union perf_event *event, | ||
150 | struct perf_sample *sample, | ||
151 | struct perf_session *session); | ||
152 | |||
153 | int perf_event__synthesize_thread_map(struct thread_map *threads, | ||
154 | perf_event__handler_t process, | ||
155 | struct perf_session *session); | ||
156 | int perf_event__synthesize_threads(perf_event__handler_t process, | ||
157 | struct perf_session *session); | ||
158 | int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, | ||
159 | struct perf_session *session, | ||
160 | struct machine *machine, | ||
161 | const char *symbol_name); | ||
162 | |||
163 | int perf_event__synthesize_modules(perf_event__handler_t process, | ||
164 | struct perf_session *session, | ||
165 | struct machine *machine); | ||
166 | |||
167 | int perf_event__process_comm(union perf_event *event, struct perf_sample *sample, | ||
141 | struct perf_session *session); | 168 | struct perf_session *session); |
142 | void event__synthesize_threads(event__handler_t process, | 169 | int perf_event__process_lost(union perf_event *event, struct perf_sample *sample, |
143 | struct perf_session *session); | 170 | struct perf_session *session); |
144 | int event__synthesize_kernel_mmap(event__handler_t process, | 171 | int perf_event__process_mmap(union perf_event *event, struct perf_sample *sample, |
145 | struct perf_session *session, | 172 | struct perf_session *session); |
146 | struct machine *machine, | 173 | int perf_event__process_task(union perf_event *event, struct perf_sample *sample, |
147 | const char *symbol_name); | 174 | struct perf_session *session); |
148 | 175 | int perf_event__process(union perf_event *event, struct perf_sample *sample, | |
149 | int event__synthesize_modules(event__handler_t process, | 176 | struct perf_session *session); |
150 | struct perf_session *session, | ||
151 | struct machine *machine); | ||
152 | |||
153 | int event__process_comm(event_t *self, struct perf_session *session); | ||
154 | int event__process_lost(event_t *self, struct perf_session *session); | ||
155 | int event__process_mmap(event_t *self, struct perf_session *session); | ||
156 | int event__process_task(event_t *self, struct perf_session *session); | ||
157 | int event__process(event_t *event, struct perf_session *session); | ||
158 | 177 | ||
159 | struct addr_location; | 178 | struct addr_location; |
160 | int event__preprocess_sample(const event_t *self, struct perf_session *session, | 179 | int perf_event__preprocess_sample(const union perf_event *self, |
161 | struct addr_location *al, struct sample_data *data, | 180 | struct perf_session *session, |
162 | symbol_filter_t filter); | 181 | struct addr_location *al, |
163 | int event__parse_sample(const event_t *event, u64 type, struct sample_data *data); | 182 | struct perf_sample *sample, |
183 | symbol_filter_t filter); | ||
184 | |||
185 | const char *perf_event__name(unsigned int id); | ||
164 | 186 | ||
165 | extern const char *event__name[]; | 187 | int perf_event__parse_sample(const union perf_event *event, u64 type, |
188 | int sample_size, bool sample_id_all, | ||
189 | struct perf_sample *sample); | ||
166 | 190 | ||
167 | #endif /* __PERF_RECORD_H */ | 191 | #endif /* __PERF_RECORD_H */ |