1 #ifndef __PERF_RECORD_H
2 #define __PERF_RECORD_H
6 #include <linux/list.h>
7 #include <linux/rbtree.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 struct perf_event_header header;
64 #define BUILD_ID_SIZE 20
66 struct build_id_event {
67 struct perf_event_header header;
68 u8 build_id[ALIGN(BUILD_ID_SIZE, sizeof(u64))];
72 typedef union event_union {
73 struct perf_event_header header;
75 struct mmap_event mmap;
76 struct comm_event comm;
77 struct fork_event fork;
78 struct lost_event lost;
79 struct read_event read;
80 struct sample_event sample;
91 struct rb_node rb_node;
92 struct list_head node;
98 u64 (*map_ip)(struct map *, u64);
99 u64 (*unmap_ip)(struct map *, u64);
103 static inline u64 map__map_ip(struct map *map, u64 ip)
105 return ip - map->start + map->pgoff;
108 static inline u64 map__unmap_ip(struct map *map, u64 ip)
110 return ip + map->start - map->pgoff;
113 static inline u64 identity__map_ip(struct map *map __used, u64 ip)
120 typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym);
122 void map__init(struct map *self, enum map_type type,
123 u64 start, u64 end, u64 pgoff, struct dso *dso);
124 struct map *map__new(struct mmap_event *event, enum map_type,
125 char *cwd, int cwdlen);
126 void map__delete(struct map *self);
127 struct map *map__clone(struct map *self);
128 int map__overlap(struct map *l, struct map *r);
129 size_t map__fprintf(struct map *self, FILE *fp);
130 struct symbol *map__find_symbol(struct map *self, u64 addr,
131 symbol_filter_t filter);
132 void map__fixup_start(struct map *self);
133 void map__fixup_end(struct map *self);
135 int event__synthesize_thread(pid_t pid, int (*process)(event_t *event));
136 void event__synthesize_threads(int (*process)(event_t *event));
138 #endif /* __PERF_RECORD_H */