perf tools: Put the show mode into the event headers files
[linux-2.6/btrfs-unstable.git] / tools / perf / util / event.h
blobfa2d4e91d3291d0814a03b20bd7d12c9af66afd2
1 #ifndef __PERF_EVENT_H
2 #define __PERF_EVENT_H
3 #include "../perf.h"
4 #include "util.h"
5 #include <linux/list.h>
7 enum {
8 SHOW_KERNEL = 1,
9 SHOW_USER = 2,
10 SHOW_HV = 4,
14 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
16 struct ip_event {
17 struct perf_event_header header;
18 u64 ip;
19 u32 pid, tid;
20 unsigned char __more_data[];
23 struct mmap_event {
24 struct perf_event_header header;
25 u32 pid, tid;
26 u64 start;
27 u64 len;
28 u64 pgoff;
29 char filename[PATH_MAX];
32 struct comm_event {
33 struct perf_event_header header;
34 u32 pid, tid;
35 char comm[16];
38 struct fork_event {
39 struct perf_event_header header;
40 u32 pid, ppid;
41 u32 tid, ptid;
44 struct lost_event {
45 struct perf_event_header header;
46 u64 id;
47 u64 lost;
51 * PERF_FORMAT_ENABLED | PERF_FORMAT_RUNNING | PERF_FORMAT_ID
53 struct read_event {
54 struct perf_event_header header;
55 u32 pid,tid;
56 u64 value;
57 u64 time_enabled;
58 u64 time_running;
59 u64 id;
62 typedef union event_union {
63 struct perf_event_header header;
64 struct ip_event ip;
65 struct mmap_event mmap;
66 struct comm_event comm;
67 struct fork_event fork;
68 struct lost_event lost;
69 struct read_event read;
70 } event_t;
72 struct map {
73 struct list_head node;
74 u64 start;
75 u64 end;
76 u64 pgoff;
77 u64 (*map_ip)(struct map *, u64);
78 struct dso *dso;
81 static inline u64 map__map_ip(struct map *map, u64 ip)
83 return ip - map->start + map->pgoff;
86 static inline u64 vdso__map_ip(struct map *map __used, u64 ip)
88 return ip;
91 struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen);
92 struct map *map__clone(struct map *self);
93 int map__overlap(struct map *l, struct map *r);
94 size_t map__fprintf(struct map *self, FILE *fp);
96 #endif