aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /tools/perf/util/event.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (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.h82
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
59struct sample_event { 66struct sample_event {
60 struct perf_event_header header; 67 struct perf_event_header header;
61 u64 array[]; 68 u64 array[];
62}; 69};
63 70
64struct sample_data { 71struct 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
87enum perf_user_event_type { /* above any possible kernel type */ 94enum 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
119typedef union event_union { 127union 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
134void event__print_totals(void); 142void perf_event__print_totals(void);
135 143
136struct perf_session; 144struct perf_session;
137 145struct thread_map;
138typedef int (*event__handler_t)(event_t *event, struct perf_session *session); 146
139 147typedef int (*perf_event__handler_synth_t)(union perf_event *event,
140int event__synthesize_thread(pid_t pid, event__handler_t process, 148 struct perf_session *session);
149typedef int (*perf_event__handler_t)(union perf_event *event,
150 struct perf_sample *sample,
151 struct perf_session *session);
152
153int perf_event__synthesize_thread_map(struct thread_map *threads,
154 perf_event__handler_t process,
155 struct perf_session *session);
156int perf_event__synthesize_threads(perf_event__handler_t process,
157 struct perf_session *session);
158int 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
163int perf_event__synthesize_modules(perf_event__handler_t process,
164 struct perf_session *session,
165 struct machine *machine);
166
167int perf_event__process_comm(union perf_event *event, struct perf_sample *sample,
141 struct perf_session *session); 168 struct perf_session *session);
142void event__synthesize_threads(event__handler_t process, 169int perf_event__process_lost(union perf_event *event, struct perf_sample *sample,
143 struct perf_session *session); 170 struct perf_session *session);
144int event__synthesize_kernel_mmap(event__handler_t process, 171int 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, 173int perf_event__process_task(union perf_event *event, struct perf_sample *sample,
147 const char *symbol_name); 174 struct perf_session *session);
148 175int perf_event__process(union perf_event *event, struct perf_sample *sample,
149int event__synthesize_modules(event__handler_t process, 176 struct perf_session *session);
150 struct perf_session *session,
151 struct machine *machine);
152
153int event__process_comm(event_t *self, struct perf_session *session);
154int event__process_lost(event_t *self, struct perf_session *session);
155int event__process_mmap(event_t *self, struct perf_session *session);
156int event__process_task(event_t *self, struct perf_session *session);
157int event__process(event_t *event, struct perf_session *session);
158 177
159struct addr_location; 178struct addr_location;
160int event__preprocess_sample(const event_t *self, struct perf_session *session, 179int 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,
163int event__parse_sample(const event_t *event, u64 type, struct sample_data *data); 182 struct perf_sample *sample,
183 symbol_filter_t filter);
184
185const char *perf_event__name(unsigned int id);
164 186
165extern const char *event__name[]; 187int 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 */