1 #ifndef __PERF_RECORD_H
2 #define __PERF_RECORD_H
10 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
13 struct perf_event_header header
;
16 unsigned char __more_data
[];
20 struct perf_event_header header
;
25 char filename
[PATH_MAX
];
29 struct perf_event_header header
;
35 struct perf_event_header header
;
42 struct perf_event_header header
;
48 * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
51 struct perf_event_header header
;
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)
67 struct perf_event_header header
;
82 struct ip_callchain
*callchain
;
85 #define BUILD_ID_SIZE 20
87 struct build_id_event
{
88 struct perf_event_header header
;
90 u8 build_id
[ALIGN(BUILD_ID_SIZE
, sizeof(u64
))];
94 enum perf_user_event_type
{ /* above any possible kernel type */
95 PERF_RECORD_USER_TYPE_START
= 64,
96 PERF_RECORD_HEADER_ATTR
= 64,
97 PERF_RECORD_HEADER_EVENT_TYPE
= 65,
98 PERF_RECORD_HEADER_TRACING_DATA
= 66,
99 PERF_RECORD_HEADER_BUILD_ID
= 67,
100 PERF_RECORD_FINISHED_ROUND
= 68,
101 PERF_RECORD_HEADER_MAX
105 struct perf_event_header header
;
106 struct perf_event_attr attr
;
110 #define MAX_EVENT_NAME 64
112 struct perf_trace_event_type
{
114 char name
[MAX_EVENT_NAME
];
117 struct event_type_event
{
118 struct perf_event_header header
;
119 struct perf_trace_event_type event_type
;
122 struct tracing_data_event
{
123 struct perf_event_header header
;
128 struct perf_event_header header
;
130 struct mmap_event mmap
;
131 struct comm_event comm
;
132 struct fork_event fork
;
133 struct lost_event lost
;
134 struct read_event read
;
135 struct sample_event sample
;
136 struct attr_event attr
;
137 struct event_type_event event_type
;
138 struct tracing_data_event tracing_data
;
139 struct build_id_event build_id
;
142 void perf_event__print_totals(void);
147 typedef int (*perf_event__handler_synth_t
)(union perf_event
*event
,
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
);
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
);
163 int perf_event__synthesize_modules(perf_event__handler_t process
,
164 struct perf_session
*session
,
165 struct machine
*machine
);
167 int perf_event__process_comm(union perf_event
*event
, struct perf_sample
*sample
,
168 struct perf_session
*session
);
169 int perf_event__process_lost(union perf_event
*event
, struct perf_sample
*sample
,
170 struct perf_session
*session
);
171 int perf_event__process_mmap(union perf_event
*event
, struct perf_sample
*sample
,
172 struct perf_session
*session
);
173 int perf_event__process_task(union perf_event
*event
, struct perf_sample
*sample
,
174 struct perf_session
*session
);
175 int perf_event__process(union perf_event
*event
, struct perf_sample
*sample
,
176 struct perf_session
*session
);
178 struct addr_location
;
179 int perf_event__preprocess_sample(const union perf_event
*self
,
180 struct perf_session
*session
,
181 struct addr_location
*al
,
182 struct perf_sample
*sample
,
183 symbol_filter_t filter
);
185 const char *perf_event__name(unsigned int id
);
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
);
191 #endif /* __PERF_RECORD_H */