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/session.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/session.h')
-rw-r--r-- | tools/perf/util/session.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h new file mode 100644 index 000000000000..5c33417eebb3 --- /dev/null +++ b/tools/perf/util/session.h | |||
@@ -0,0 +1,89 @@ | |||
1 | #ifndef __PERF_SESSION_H | ||
2 | #define __PERF_SESSION_H | ||
3 | |||
4 | #include "event.h" | ||
5 | #include "header.h" | ||
6 | #include "symbol.h" | ||
7 | #include "thread.h" | ||
8 | #include <linux/rbtree.h> | ||
9 | #include "../../../include/linux/perf_event.h" | ||
10 | |||
11 | struct ip_callchain; | ||
12 | struct thread; | ||
13 | |||
14 | struct perf_session { | ||
15 | struct perf_header header; | ||
16 | unsigned long size; | ||
17 | unsigned long mmap_window; | ||
18 | struct map_groups kmaps; | ||
19 | struct rb_root threads; | ||
20 | struct thread *last_match; | ||
21 | struct map *vmlinux_maps[MAP__NR_TYPES]; | ||
22 | struct events_stats events_stats; | ||
23 | struct rb_root stats_by_id; | ||
24 | unsigned long event_total[PERF_RECORD_MAX]; | ||
25 | unsigned long unknown_events; | ||
26 | struct rb_root hists; | ||
27 | u64 sample_type; | ||
28 | struct ref_reloc_sym ref_reloc_sym; | ||
29 | int fd; | ||
30 | int cwdlen; | ||
31 | char *cwd; | ||
32 | char filename[0]; | ||
33 | }; | ||
34 | |||
35 | typedef int (*event_op)(event_t *self, struct perf_session *session); | ||
36 | |||
37 | struct perf_event_ops { | ||
38 | event_op sample, | ||
39 | mmap, | ||
40 | comm, | ||
41 | fork, | ||
42 | exit, | ||
43 | lost, | ||
44 | read, | ||
45 | throttle, | ||
46 | unthrottle; | ||
47 | }; | ||
48 | |||
49 | struct perf_session *perf_session__new(const char *filename, int mode, bool force); | ||
50 | void perf_session__delete(struct perf_session *self); | ||
51 | |||
52 | void perf_event_header__bswap(struct perf_event_header *self); | ||
53 | |||
54 | int __perf_session__process_events(struct perf_session *self, | ||
55 | u64 data_offset, u64 data_size, u64 size, | ||
56 | struct perf_event_ops *ops); | ||
57 | int perf_session__process_events(struct perf_session *self, | ||
58 | struct perf_event_ops *event_ops); | ||
59 | |||
60 | struct symbol **perf_session__resolve_callchain(struct perf_session *self, | ||
61 | struct thread *thread, | ||
62 | struct ip_callchain *chain, | ||
63 | struct symbol **parent); | ||
64 | |||
65 | bool perf_session__has_traces(struct perf_session *self, const char *msg); | ||
66 | |||
67 | int perf_header__read_build_ids(struct perf_header *self, int input, | ||
68 | u64 offset, u64 file_size); | ||
69 | |||
70 | int perf_session__set_kallsyms_ref_reloc_sym(struct perf_session *self, | ||
71 | const char *symbol_name, | ||
72 | u64 addr); | ||
73 | |||
74 | void mem_bswap_64(void *src, int byte_size); | ||
75 | |||
76 | static inline int __perf_session__create_kernel_maps(struct perf_session *self, | ||
77 | struct dso *kernel) | ||
78 | { | ||
79 | return __map_groups__create_kernel_maps(&self->kmaps, | ||
80 | self->vmlinux_maps, kernel); | ||
81 | } | ||
82 | |||
83 | static inline struct map * | ||
84 | perf_session__new_module_map(struct perf_session *self, | ||
85 | u64 start, const char *filename) | ||
86 | { | ||
87 | return map_groups__new_module(&self->kmaps, start, filename); | ||
88 | } | ||
89 | #endif /* __PERF_SESSION_H */ | ||