diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /tools/perf/util/event.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r-- | tools/perf/util/event.h | 91 |
1 files changed, 62 insertions, 29 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 2c9c26d6ded0..a33b94952e34 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -1,14 +1,10 @@ | |||
1 | #ifndef __PERF_RECORD_H | 1 | #ifndef __PERF_RECORD_H |
2 | #define __PERF_RECORD_H | 2 | #define __PERF_RECORD_H |
3 | #include "../perf.h" | ||
4 | #include "util.h" | ||
5 | #include <linux/list.h> | ||
6 | 3 | ||
7 | enum { | 4 | #include <limits.h> |
8 | SHOW_KERNEL = 1, | 5 | |
9 | SHOW_USER = 2, | 6 | #include "../perf.h" |
10 | SHOW_HV = 4, | 7 | #include "map.h" |
11 | }; | ||
12 | 8 | ||
13 | /* | 9 | /* |
14 | * PERF_SAMPLE_IP | PERF_SAMPLE_TID | * | 10 | * PERF_SAMPLE_IP | PERF_SAMPLE_TID | * |
@@ -60,11 +56,32 @@ struct read_event { | |||
60 | u64 id; | 56 | u64 id; |
61 | }; | 57 | }; |
62 | 58 | ||
63 | struct sample_event{ | 59 | struct sample_event { |
64 | struct perf_event_header header; | 60 | struct perf_event_header header; |
65 | u64 array[]; | 61 | u64 array[]; |
66 | }; | 62 | }; |
67 | 63 | ||
64 | struct sample_data { | ||
65 | u64 ip; | ||
66 | u32 pid, tid; | ||
67 | u64 time; | ||
68 | u64 addr; | ||
69 | u64 id; | ||
70 | u64 stream_id; | ||
71 | u32 cpu; | ||
72 | u64 period; | ||
73 | struct ip_callchain *callchain; | ||
74 | u32 raw_size; | ||
75 | void *raw_data; | ||
76 | }; | ||
77 | |||
78 | #define BUILD_ID_SIZE 20 | ||
79 | |||
80 | struct build_id_event { | ||
81 | struct perf_event_header header; | ||
82 | u8 build_id[ALIGN(BUILD_ID_SIZE, sizeof(u64))]; | ||
83 | char filename[]; | ||
84 | }; | ||
68 | 85 | ||
69 | typedef union event_union { | 86 | typedef union event_union { |
70 | struct perf_event_header header; | 87 | struct perf_event_header header; |
@@ -77,28 +94,44 @@ typedef union event_union { | |||
77 | struct sample_event sample; | 94 | struct sample_event sample; |
78 | } event_t; | 95 | } event_t; |
79 | 96 | ||
80 | struct map { | 97 | struct events_stats { |
81 | struct list_head node; | 98 | u64 total; |
82 | u64 start; | 99 | u64 lost; |
83 | u64 end; | ||
84 | u64 pgoff; | ||
85 | u64 (*map_ip)(struct map *, u64); | ||
86 | struct dso *dso; | ||
87 | }; | 100 | }; |
88 | 101 | ||
89 | static inline u64 map__map_ip(struct map *map, u64 ip) | 102 | struct event_stat_id { |
90 | { | 103 | struct rb_node rb_node; |
91 | return ip - map->start + map->pgoff; | 104 | struct rb_root hists; |
92 | } | 105 | struct events_stats stats; |
106 | u64 config; | ||
107 | u64 event_stream; | ||
108 | u32 type; | ||
109 | }; | ||
110 | |||
111 | void event__print_totals(void); | ||
112 | |||
113 | struct perf_session; | ||
114 | |||
115 | typedef int (*event__handler_t)(event_t *event, struct perf_session *session); | ||
116 | |||
117 | int event__synthesize_thread(pid_t pid, event__handler_t process, | ||
118 | struct perf_session *session); | ||
119 | void event__synthesize_threads(event__handler_t process, | ||
120 | struct perf_session *session); | ||
121 | int event__synthesize_kernel_mmap(event__handler_t process, | ||
122 | struct perf_session *session, | ||
123 | const char *symbol_name); | ||
124 | int event__synthesize_modules(event__handler_t process, | ||
125 | struct perf_session *session); | ||
93 | 126 | ||
94 | static inline u64 vdso__map_ip(struct map *map __used, u64 ip) | 127 | int event__process_comm(event_t *self, struct perf_session *session); |
95 | { | 128 | int event__process_lost(event_t *self, struct perf_session *session); |
96 | return ip; | 129 | int event__process_mmap(event_t *self, struct perf_session *session); |
97 | } | 130 | int event__process_task(event_t *self, struct perf_session *session); |
98 | 131 | ||
99 | struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen); | 132 | struct addr_location; |
100 | struct map *map__clone(struct map *self); | 133 | int event__preprocess_sample(const event_t *self, struct perf_session *session, |
101 | int map__overlap(struct map *l, struct map *r); | 134 | struct addr_location *al, symbol_filter_t filter); |
102 | size_t map__fprintf(struct map *self, FILE *fp); | 135 | int event__parse_sample(event_t *event, u64 type, struct sample_data *data); |
103 | 136 | ||
104 | #endif | 137 | #endif /* __PERF_RECORD_H */ |