1 #ifndef __PERF_RECORD_H
2 #define __PERF_RECORD_H
12 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
15 struct perf_event_header header
;
18 unsigned char __more_data
[];
22 struct perf_event_header header
;
27 char filename
[PATH_MAX
];
31 struct perf_event_header header
;
37 struct perf_event_header header
;
44 struct perf_event_header header
;
50 * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
53 struct perf_event_header header
;
62 #define PERF_SAMPLE_MASK \
63 (PERF_SAMPLE_IP | PERF_SAMPLE_TID | \
64 PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR | \
65 PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID | \
66 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)
69 struct perf_event_header header
;
94 struct ip_callchain
*callchain
;
95 struct branch_stack
*branch_stack
;
96 struct regs_dump user_regs
;
97 struct stack_dump user_stack
;
100 struct build_id_event
{
101 struct perf_event_header header
;
103 u8 build_id
[PERF_ALIGN(BUILD_ID_SIZE
, sizeof(u64
))];
107 enum perf_user_event_type
{ /* above any possible kernel type */
108 PERF_RECORD_USER_TYPE_START
= 64,
109 PERF_RECORD_HEADER_ATTR
= 64,
110 PERF_RECORD_HEADER_EVENT_TYPE
= 65,
111 PERF_RECORD_HEADER_TRACING_DATA
= 66,
112 PERF_RECORD_HEADER_BUILD_ID
= 67,
113 PERF_RECORD_FINISHED_ROUND
= 68,
114 PERF_RECORD_HEADER_MAX
118 struct perf_event_header header
;
119 struct perf_event_attr attr
;
123 #define MAX_EVENT_NAME 64
125 struct perf_trace_event_type
{
127 char name
[MAX_EVENT_NAME
];
130 struct event_type_event
{
131 struct perf_event_header header
;
132 struct perf_trace_event_type event_type
;
135 struct tracing_data_event
{
136 struct perf_event_header header
;
141 struct perf_event_header header
;
143 struct mmap_event mmap
;
144 struct comm_event comm
;
145 struct fork_event fork
;
146 struct lost_event lost
;
147 struct read_event read
;
148 struct sample_event sample
;
149 struct attr_event attr
;
150 struct event_type_event event_type
;
151 struct tracing_data_event tracing_data
;
152 struct build_id_event build_id
;
155 void perf_event__print_totals(void);
160 typedef int (*perf_event__handler_t
)(struct perf_tool
*tool
,
161 union perf_event
*event
,
162 struct perf_sample
*sample
,
163 struct machine
*machine
);
165 int perf_event__synthesize_thread_map(struct perf_tool
*tool
,
166 struct thread_map
*threads
,
167 perf_event__handler_t process
,
168 struct machine
*machine
);
169 int perf_event__synthesize_threads(struct perf_tool
*tool
,
170 perf_event__handler_t process
,
171 struct machine
*machine
);
172 int perf_event__synthesize_kernel_mmap(struct perf_tool
*tool
,
173 perf_event__handler_t process
,
174 struct machine
*machine
,
175 const char *symbol_name
);
177 int perf_event__synthesize_modules(struct perf_tool
*tool
,
178 perf_event__handler_t process
,
179 struct machine
*machine
);
181 int perf_event__process_comm(struct perf_tool
*tool
,
182 union perf_event
*event
,
183 struct perf_sample
*sample
,
184 struct machine
*machine
);
185 int perf_event__process_lost(struct perf_tool
*tool
,
186 union perf_event
*event
,
187 struct perf_sample
*sample
,
188 struct machine
*machine
);
189 int perf_event__process_mmap(struct perf_tool
*tool
,
190 union perf_event
*event
,
191 struct perf_sample
*sample
,
192 struct machine
*machine
);
193 int perf_event__process_fork(struct perf_tool
*tool
,
194 union perf_event
*event
,
195 struct perf_sample
*sample
,
196 struct machine
*machine
);
197 int perf_event__process_exit(struct perf_tool
*tool
,
198 union perf_event
*event
,
199 struct perf_sample
*sample
,
200 struct machine
*machine
);
201 int perf_event__process(struct perf_tool
*tool
,
202 union perf_event
*event
,
203 struct perf_sample
*sample
,
204 struct machine
*machine
);
206 struct addr_location
;
207 int perf_event__preprocess_sample(const union perf_event
*self
,
208 struct machine
*machine
,
209 struct addr_location
*al
,
210 struct perf_sample
*sample
,
211 symbol_filter_t filter
);
213 const char *perf_event__name(unsigned int id
);
215 int perf_event__synthesize_sample(union perf_event
*event
, u64 type
,
216 const struct perf_sample
*sample
,
219 size_t perf_event__fprintf_comm(union perf_event
*event
, FILE *fp
);
220 size_t perf_event__fprintf_mmap(union perf_event
*event
, FILE *fp
);
221 size_t perf_event__fprintf_task(union perf_event
*event
, FILE *fp
);
222 size_t perf_event__fprintf(union perf_event
*event
, FILE *fp
);
224 #endif /* __PERF_RECORD_H */