]> Pileus Git - ~andy/linux/blobdiff - tools/perf/util/event.h
perf symbols: Allow lookups by symbol name too
[~andy/linux] / tools / perf / util / event.h
index 3ae3c964c901d5a2ead2b69d376a48ecdc3f1fde..51a96c2effdea662c4a77e5b5a2ed3cde1e61b64 100644 (file)
@@ -56,11 +56,25 @@ struct read_event {
        u64 id;
 };
 
-struct sample_event{
+struct sample_event {
        struct perf_event_header        header;
        u64 array[];
 };
 
+struct sample_data {
+       u64 ip;
+       u32 pid, tid;
+       u64 time;
+       u64 addr;
+       u64 id;
+       u64 stream_id;
+       u32 cpu;
+       u64 period;
+       struct ip_callchain *callchain;
+       u32 raw_size;
+       void *raw_data;
+};
+
 #define BUILD_ID_SIZE 20
 
 struct build_id_event {
@@ -80,12 +94,20 @@ typedef union event_union {
        struct sample_event             sample;
 } event_t;
 
+struct events_stats {
+       unsigned long total;
+       unsigned long lost;
+};
+
+void event__print_totals(void);
+
 enum map_type {
        MAP__FUNCTION = 0,
-
-       MAP__NR_TYPES,
+       MAP__VARIABLE,
 };
 
+#define MAP__NR_TYPES (MAP__VARIABLE + 1)
+
 struct map {
        union {
                struct rb_node  rb_node;
@@ -129,10 +151,27 @@ int map__overlap(struct map *l, struct map *r);
 size_t map__fprintf(struct map *self, FILE *fp);
 struct symbol *map__find_symbol(struct map *self, u64 addr,
                                symbol_filter_t filter);
+struct symbol *map__find_symbol_by_name(struct map *self, const char *name,
+                                       symbol_filter_t filter);
 void map__fixup_start(struct map *self);
 void map__fixup_end(struct map *self);
 
 int event__synthesize_thread(pid_t pid, int (*process)(event_t *event));
 void event__synthesize_threads(int (*process)(event_t *event));
 
+extern char *event__cwd;
+extern int  event__cwdlen;
+extern struct events_stats event__stats;
+extern unsigned long event__total[PERF_RECORD_MAX];
+
+int event__process_comm(event_t *self);
+int event__process_lost(event_t *self);
+int event__process_mmap(event_t *self);
+int event__process_task(event_t *self);
+
+struct addr_location;
+int event__preprocess_sample(const event_t *self, struct addr_location *al,
+                            symbol_filter_t filter);
+int event__parse_sample(event_t *event, u64 type, struct sample_data *data);
+
 #endif /* __PERF_RECORD_H */