aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-02-03 13:52:00 -0500
committerIngo Molnar <mingo@elte.hu>2010-02-04 03:33:24 -0500
commit9de89fe7c577847877ae00ea1aa6315559b10243 (patch)
tree523bcd2c2b1e2a839100b472ff864860cdc8caeb /tools/perf/util/map.h
parentb8f46c5a34fa64fd456295388d18f50ae69d9f37 (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.h22
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
16struct dso; 16struct dso;
17struct ref_reloc_sym;
18struct map_groups;
17 19
18struct map { 20struct map {
19 union { 21 union {
@@ -29,6 +31,16 @@ struct map {
29 struct dso *dso; 31 struct dso *dso;
30}; 32};
31 33
34struct kmap {
35 struct ref_reloc_sym *ref_reloc_sym;
36 struct map_groups *kmaps;
37};
38
39static inline struct kmap *map__kmap(struct map *self)
40{
41 return (struct kmap *)(self + 1);
42}
43
32static inline u64 map__map_ip(struct map *map, u64 ip) 44static 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);
58int map__overlap(struct map *l, struct map *r); 70int map__overlap(struct map *l, struct map *r);
59size_t map__fprintf(struct map *self, FILE *fp); 71size_t map__fprintf(struct map *self, FILE *fp);
60 72
61struct perf_session; 73int map__load(struct map *self, symbol_filter_t filter);
62 74struct symbol *map__find_symbol(struct map *self,
63int map__load(struct map *self, struct perf_session *session,
64 symbol_filter_t filter);
65struct 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);
67struct symbol *map__find_symbol_by_name(struct map *self, const char *name, 76struct 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);
70void map__fixup_start(struct map *self); 78void map__fixup_start(struct map *self);
71void map__fixup_end(struct map *self); 79void map__fixup_end(struct map *self);
72 80
81void map__reloc_vmlinux(struct map *self);
82
73#endif /* __PERF_MAP_H */ 83#endif /* __PERF_MAP_H */