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/map.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/map.h')
-rw-r--r-- | tools/perf/util/map.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 72f0b6ab5ea5..de048399d776 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -14,6 +14,8 @@ enum map_type { | |||
14 | #define MAP__NR_TYPES (MAP__VARIABLE + 1) | 14 | #define MAP__NR_TYPES (MAP__VARIABLE + 1) |
15 | 15 | ||
16 | struct dso; | 16 | struct dso; |
17 | struct ref_reloc_sym; | ||
18 | struct map_groups; | ||
17 | 19 | ||
18 | struct map { | 20 | struct map { |
19 | union { | 21 | union { |
@@ -29,6 +31,16 @@ struct map { | |||
29 | struct dso *dso; | 31 | struct dso *dso; |
30 | }; | 32 | }; |
31 | 33 | ||
34 | struct kmap { | ||
35 | struct ref_reloc_sym *ref_reloc_sym; | ||
36 | struct map_groups *kmaps; | ||
37 | }; | ||
38 | |||
39 | static inline struct kmap *map__kmap(struct map *self) | ||
40 | { | ||
41 | return (struct kmap *)(self + 1); | ||
42 | } | ||
43 | |||
32 | static inline u64 map__map_ip(struct map *map, u64 ip) | 44 | static inline u64 map__map_ip(struct map *map, u64 ip) |
33 | { | 45 | { |
34 | return ip - map->start + map->pgoff; | 46 | return ip - map->start + map->pgoff; |
@@ -58,16 +70,14 @@ struct map *map__clone(struct map *self); | |||
58 | int map__overlap(struct map *l, struct map *r); | 70 | int map__overlap(struct map *l, struct map *r); |
59 | size_t map__fprintf(struct map *self, FILE *fp); | 71 | size_t map__fprintf(struct map *self, FILE *fp); |
60 | 72 | ||
61 | struct perf_session; | 73 | int map__load(struct map *self, symbol_filter_t filter); |
62 | 74 | struct symbol *map__find_symbol(struct map *self, | |
63 | int map__load(struct map *self, struct perf_session *session, | ||
64 | symbol_filter_t filter); | ||
65 | struct symbol *map__find_symbol(struct map *self, struct perf_session *session, | ||
66 | u64 addr, symbol_filter_t filter); | 75 | u64 addr, symbol_filter_t filter); |
67 | struct symbol *map__find_symbol_by_name(struct map *self, const char *name, | 76 | struct symbol *map__find_symbol_by_name(struct map *self, const char *name, |
68 | struct perf_session *session, | ||
69 | symbol_filter_t filter); | 77 | symbol_filter_t filter); |
70 | void map__fixup_start(struct map *self); | 78 | void map__fixup_start(struct map *self); |
71 | void map__fixup_end(struct map *self); | 79 | void map__fixup_end(struct map *self); |
72 | 80 | ||
81 | void map__reloc_vmlinux(struct map *self); | ||
82 | |||
73 | #endif /* __PERF_MAP_H */ | 83 | #endif /* __PERF_MAP_H */ |