aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /tools/perf/util/event.h
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (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.h91
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
7enum { 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
63struct sample_event{ 59struct sample_event {
64 struct perf_event_header header; 60 struct perf_event_header header;
65 u64 array[]; 61 u64 array[];
66}; 62};
67 63
64struct 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
80struct 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
69typedef union event_union { 86typedef 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
80struct map { 97struct 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
89static inline u64 map__map_ip(struct map *map, u64 ip) 102struct 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
111void event__print_totals(void);
112
113struct perf_session;
114
115typedef int (*event__handler_t)(event_t *event, struct perf_session *session);
116
117int event__synthesize_thread(pid_t pid, event__handler_t process,
118 struct perf_session *session);
119void event__synthesize_threads(event__handler_t process,
120 struct perf_session *session);
121int event__synthesize_kernel_mmap(event__handler_t process,
122 struct perf_session *session,
123 const char *symbol_name);
124int event__synthesize_modules(event__handler_t process,
125 struct perf_session *session);
93 126
94static inline u64 vdso__map_ip(struct map *map __used, u64 ip) 127int event__process_comm(event_t *self, struct perf_session *session);
95{ 128int event__process_lost(event_t *self, struct perf_session *session);
96 return ip; 129int event__process_mmap(event_t *self, struct perf_session *session);
97} 130int event__process_task(event_t *self, struct perf_session *session);
98 131
99struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen); 132struct addr_location;
100struct map *map__clone(struct map *self); 133int event__preprocess_sample(const event_t *self, struct perf_session *session,
101int map__overlap(struct map *l, struct map *r); 134 struct addr_location *al, symbol_filter_t filter);
102size_t map__fprintf(struct map *self, FILE *fp); 135int event__parse_sample(event_t *event, u64 type, struct sample_data *data);
103 136
104#endif 137#endif /* __PERF_RECORD_H */