1 #ifndef __PERF_RECORD_H
2 #define __PERF_RECORD_H
11 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
14 struct perf_event_header header
;
17 unsigned char __more_data
[];
21 struct perf_event_header header
;
26 char filename
[PATH_MAX
];
30 struct perf_event_header header
;
36 struct perf_event_header header
;
43 struct perf_event_header header
;
49 * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
52 struct perf_event_header header
;
61 #define PERF_SAMPLE_MASK \
62 (PERF_SAMPLE_IP | PERF_SAMPLE_TID | \
63 PERF_SAMPLE_TIME | PERF_SAMPLE_ADDR | \
64 PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID | \
65 PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD)
68 struct perf_event_header header
;
93 struct ip_callchain
*callchain
;
94 struct branch_stack
*branch_stack
;
95 struct regs_dump user_regs
;
96 struct stack_dump user_stack
;
99 #define BUILD_ID_SIZE 20
101 struct build_id_event
{
102 struct perf_event_header header
;
104 u8 build_id
[PERF_ALIGN(BUILD_ID_SIZE
, sizeof(u64
))];
108 enum perf_user_event_type
{ /* above any possible kernel type */
109 PERF_RECORD_USER_TYPE_START
= 64,
110 PERF_RECORD_HEADER_ATTR
= 64,
111 PERF_RECORD_HEADER_EVENT_TYPE
= 65,
112 PERF_RECORD_HEADER_TRACING_DATA
= 66,
113 PERF_RECORD_HEADER_BUILD_ID
= 67,
114 PERF_RECORD_FINISHED_ROUND
= 68,
115 PERF_RECORD_HEADER_MAX
119 struct perf_event_header header
;
120 struct perf_event_attr attr
;
124 #define MAX_EVENT_NAME 64
126 struct perf_trace_event_type
{
128 char name
[MAX_EVENT_NAME
];
131 struct event_type_event
{
132 struct perf_event_header header
;
133 struct perf_trace_event_type event_type
;
136 struct tracing_data_event
{
137 struct perf_event_header header
;
142 struct perf_event_header header
;
144 struct mmap_event mmap
;
145 struct comm_event comm
;
146 struct fork_event fork
;
147 struct lost_event lost
;
148 struct read_event read
;
149 struct sample_event sample
;
150 struct attr_event attr
;
151 struct event_type_event event_type
;
152 struct tracing_data_event tracing_data
;
153 struct build_id_event build_id
;
156 void perf_event__print_totals(void);
161 typedef int (*perf_event__handler_t
)(struct perf_tool
*tool
,
162 union perf_event
*event
,
163 struct perf_sample
*sample
,
164 struct machine
*machine
);
166 int perf_event__synthesize_thread_map(struct perf_tool
*tool
,
167 struct thread_map
*threads
,
168 perf_event__handler_t process
,
169 struct machine
*machine
);
170 int perf_event__synthesize_threads(struct perf_tool
*tool
,
171 perf_event__handler_t process
,
172 struct machine
*machine
);
173 int perf_event__synthesize_kernel_mmap(struct perf_tool
*tool
,
174 perf_event__handler_t process
,
175 struct machine
*machine
,
176 const char *symbol_name
);
178 int perf_event__synthesize_modules(struct perf_tool
*tool
,
179 perf_event__handler_t process
,
180 struct machine
*machine
);
182 int perf_event__process_comm(struct perf_tool
*tool
,
183 union perf_event
*event
,
184 struct perf_sample
*sample
,
185 struct machine
*machine
);
186 int perf_event__process_lost(struct perf_tool
*tool
,
187 union perf_event
*event
,
188 struct perf_sample
*sample
,
189 struct machine
*machine
);
190 int perf_event__process_mmap(struct perf_tool
*tool
,
191 union perf_event
*event
,
192 struct perf_sample
*sample
,
193 struct machine
*machine
);
194 int perf_event__process_fork(struct perf_tool
*tool
,
195 union perf_event
*event
,
196 struct perf_sample
*sample
,
197 struct machine
*machine
);
198 int perf_event__process_exit(struct perf_tool
*tool
,
199 union perf_event
*event
,
200 struct perf_sample
*sample
,
201 struct machine
*machine
);
202 int perf_event__process(struct perf_tool
*tool
,
203 union perf_event
*event
,
204 struct perf_sample
*sample
,
205 struct machine
*machine
);
207 struct addr_location
;
208 int perf_event__preprocess_sample(const union perf_event
*self
,
209 struct machine
*machine
,
210 struct addr_location
*al
,
211 struct perf_sample
*sample
,
212 symbol_filter_t filter
);
214 const char *perf_event__name(unsigned int id
);
216 int perf_event__synthesize_sample(union perf_event
*event
, u64 type
,
217 const struct perf_sample
*sample
,
220 size_t perf_event__fprintf_comm(union perf_event
*event
, FILE *fp
);
221 size_t perf_event__fprintf_mmap(union perf_event
*event
, FILE *fp
);
222 size_t perf_event__fprintf_task(union perf_event
*event
, FILE *fp
);
223 size_t perf_event__fprintf(union perf_event
*event
, FILE *fp
);
225 #endif /* __PERF_RECORD_H */