mm-only debug patch...
[mmotm.git] / tools / perf / util / event.h
blobc2e62be62798a62d1cc81341a9de872621c29ee1
1 #ifndef __PERF_RECORD_H
2 #define __PERF_RECORD_H
4 #include "../perf.h"
5 #include "util.h"
6 #include <linux/list.h>
7 #include <linux/rbtree.h>
9 /*
10 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
12 struct ip_event {
13 struct perf_event_header header;
14 u64 ip;
15 u32 pid, tid;
16 unsigned char __more_data[];
19 struct mmap_event {
20 struct perf_event_header header;
21 u32 pid, tid;
22 u64 start;
23 u64 len;
24 u64 pgoff;
25 char filename[PATH_MAX];
28 struct comm_event {
29 struct perf_event_header header;
30 u32 pid, tid;
31 char comm[16];
34 struct fork_event {
35 struct perf_event_header header;
36 u32 pid, ppid;
37 u32 tid, ptid;
38 u64 time;
41 struct lost_event {
42 struct perf_event_header header;
43 u64 id;
44 u64 lost;
48 * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
50 struct read_event {
51 struct perf_event_header header;
52 u32 pid, tid;
53 u64 value;
54 u64 time_enabled;
55 u64 time_running;
56 u64 id;
59 struct sample_event{
60 struct perf_event_header header;
61 u64 array[];
65 typedef union event_union {
66 struct perf_event_header header;
67 struct ip_event ip;
68 struct mmap_event mmap;
69 struct comm_event comm;
70 struct fork_event fork;
71 struct lost_event lost;
72 struct read_event read;
73 struct sample_event sample;
74 } event_t;
76 struct map {
77 union {
78 struct rb_node rb_node;
79 struct list_head node;
81 u64 start;
82 u64 end;
83 u64 pgoff;
84 u64 (*map_ip)(struct map *, u64);
85 struct dso *dso;
88 static inline u64 map__map_ip(struct map *map, u64 ip)
90 return ip - map->start + map->pgoff;
93 static inline u64 vdso__map_ip(struct map *map __used, u64 ip)
95 return ip;
98 struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen);
99 struct map *map__clone(struct map *self);
100 int map__overlap(struct map *l, struct map *r);
101 size_t map__fprintf(struct map *self, FILE *fp);
103 #endif /* __PERF_RECORD_H */