Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
event.h
Go to the documentation of this file.
1 #ifndef __PERF_RECORD_H
2 #define __PERF_RECORD_H
3 
4 #include <limits.h>
5 #include <stdio.h>
6 
7 #include "../perf.h"
8 #include "map.h"
9 
10 /*
11  * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
12  */
13 struct ip_event {
17  unsigned char __more_data[];
18 };
19 
20 struct mmap_event {
27 };
28 
29 struct comm_event {
32  char comm[16];
33 };
34 
35 struct fork_event {
40 };
41 
42 struct lost_event {
46 };
47 
48 /*
49  * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
50  */
51 struct read_event {
58 };
59 
60 
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)
66 
67 struct sample_event {
70 };
71 
72 struct regs_dump {
74 };
75 
76 struct stack_dump {
79  char *data;
80 };
81 
82 struct perf_sample {
92  void *raw_data;
97 };
98 
99 #define BUILD_ID_SIZE 20
100 
105  char filename[];
106 };
107 
108 enum perf_user_event_type { /* above any possible kernel type */
116 };
117 
118 struct attr_event {
121  u64 id[];
122 };
123 
124 #define MAX_EVENT_NAME 64
125 
129 };
130 
134 };
135 
139 };
140 
141 union perf_event {
143  struct ip_event ip;
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;
150  struct attr_event attr;
154 };
155 
156 void perf_event__print_totals(void);
157 
158 struct perf_tool;
159 struct thread_map;
160 
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);
165 
167  struct thread_map *threads,
168  perf_event__handler_t process,
169  struct machine *machine);
171  perf_event__handler_t process,
172  struct machine *machine);
174  perf_event__handler_t process,
175  struct machine *machine,
176  const char *symbol_name);
177 
179  perf_event__handler_t process,
180  struct machine *machine);
181 
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_task(struct perf_tool *tool,
195  union perf_event *event,
196  struct perf_sample *sample,
197  struct machine *machine);
198 int perf_event__process(struct perf_tool *tool,
199  union perf_event *event,
200  struct perf_sample *sample,
201  struct machine *machine);
202 
203 struct addr_location;
204 int perf_event__preprocess_sample(const union perf_event *self,
205  struct machine *machine,
206  struct addr_location *al,
207  struct perf_sample *sample,
209 
210 const char *perf_event__name(unsigned int id);
211 
213  const struct perf_sample *sample,
214  bool swapped);
215 
216 size_t perf_event__fprintf_comm(union perf_event *event, FILE *fp);
217 size_t perf_event__fprintf_mmap(union perf_event *event, FILE *fp);
218 size_t perf_event__fprintf_task(union perf_event *event, FILE *fp);
219 size_t perf_event__fprintf(union perf_event *event, FILE *fp);
220 
221 #endif /* __PERF_RECORD_H */