diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-02-03 13:52:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-04 03:33:24 -0500 |
commit | 9de89fe7c577847877ae00ea1aa6315559b10243 (patch) | |
tree | 523bcd2c2b1e2a839100b472ff864860cdc8caeb /tools/perf/util/session.h | |
parent | b8f46c5a34fa64fd456295388d18f50ae69d9f37 (diff) |
perf symbols: Remove perf_session usage in symbols layer
I noticed while writing the first test in 'perf regtest' that to
just test the symbol handling routines one needs to create a
perf session, that is a layer centered on a perf.data file,
events, etc, so I untied these layers.
This reduces the complexity for the users as the number of
parameters to most of the symbols and session APIs now was
reduced while not adding more state to all the map instances by
only having data that is needed to split the kernel (kallsyms
and ELF symtab sections) maps and do vmlinux relocation on the
main kernel map.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1265223128-11786-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/session.h')
-rw-r--r-- | tools/perf/util/session.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 36d1a80c0b6c..752d75aebade 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -3,13 +3,13 @@ | |||
3 | 3 | ||
4 | #include "event.h" | 4 | #include "event.h" |
5 | #include "header.h" | 5 | #include "header.h" |
6 | #include "symbol.h" | ||
6 | #include "thread.h" | 7 | #include "thread.h" |
7 | #include <linux/rbtree.h> | 8 | #include <linux/rbtree.h> |
8 | #include "../../../include/linux/perf_event.h" | 9 | #include "../../../include/linux/perf_event.h" |
9 | 10 | ||
10 | struct ip_callchain; | 11 | struct ip_callchain; |
11 | struct thread; | 12 | struct thread; |
12 | struct symbol; | ||
13 | 13 | ||
14 | struct perf_session { | 14 | struct perf_session { |
15 | struct perf_header header; | 15 | struct perf_header header; |
@@ -24,10 +24,7 @@ struct perf_session { | |||
24 | unsigned long unknown_events; | 24 | unsigned long unknown_events; |
25 | struct rb_root hists; | 25 | struct rb_root hists; |
26 | u64 sample_type; | 26 | u64 sample_type; |
27 | struct { | 27 | struct ref_reloc_sym ref_reloc_sym; |
28 | const char *name; | ||
29 | u64 addr; | ||
30 | } ref_reloc_sym; | ||
31 | int fd; | 28 | int fd; |
32 | int cwdlen; | 29 | int cwdlen; |
33 | char *cwd; | 30 | char *cwd; |
@@ -69,9 +66,20 @@ int perf_header__read_build_ids(struct perf_header *self, int input, | |||
69 | int perf_session__set_kallsyms_ref_reloc_sym(struct perf_session *self, | 66 | int perf_session__set_kallsyms_ref_reloc_sym(struct perf_session *self, |
70 | const char *symbol_name, | 67 | const char *symbol_name, |
71 | u64 addr); | 68 | u64 addr); |
72 | void perf_session__reloc_vmlinux_maps(struct perf_session *self, | ||
73 | u64 unrelocated_addr); | ||
74 | 69 | ||
75 | void mem_bswap_64(void *src, int byte_size); | 70 | void mem_bswap_64(void *src, int byte_size); |
76 | 71 | ||
72 | static inline int __perf_session__create_kernel_maps(struct perf_session *self, | ||
73 | struct dso *kernel) | ||
74 | { | ||
75 | return __map_groups__create_kernel_maps(&self->kmaps, | ||
76 | self->vmlinux_maps, kernel); | ||
77 | } | ||
78 | |||
79 | static inline struct map * | ||
80 | perf_session__new_module_map(struct perf_session *self, | ||
81 | u64 start, const char *filename) | ||
82 | { | ||
83 | return map_groups__new_module(&self->kmaps, start, filename); | ||
84 | } | ||
77 | #endif /* __PERF_SESSION_H */ | 85 | #endif /* __PERF_SESSION_H */ |