aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-04-29 14:25:23 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-29 14:25:23 -0400
commit5c0541d53ef3897494768decb09eb8f1087953a5 (patch)
tree38b8eab8e45a2d2265db64b131320e6baa43b984 /tools/perf/util/map.h
parent18acde52b83bd1c8e1d007db519f46d344aa13ed (diff)
perf symbols: Add machine helper routines
Created when writing the first 'perf test' regression testing routine. Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.h')
-rw-r--r--tools/perf/util/map.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index 881dba4f8203..f39134512829 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -30,6 +30,7 @@ struct map {
30 u64 start; 30 u64 start;
31 u64 end; 31 u64 end;
32 enum map_type type; 32 enum map_type type;
33 u32 priv;
33 u64 pgoff; 34 u64 pgoff;
34 35
35 /* ip -> dso rip */ 36 /* ip -> dso rip */
@@ -66,6 +67,12 @@ struct machine {
66 struct map *vmlinux_maps[MAP__NR_TYPES]; 67 struct map *vmlinux_maps[MAP__NR_TYPES];
67}; 68};
68 69
70static inline
71struct map *machine__kernel_map(struct machine *self, enum map_type type)
72{
73 return self->vmlinux_maps[type];
74}
75
69static inline struct kmap *map__kmap(struct map *self) 76static inline struct kmap *map__kmap(struct map *self)
70{ 77{
71 return (struct kmap *)(self + 1); 78 return (struct kmap *)(self + 1);
@@ -173,11 +180,21 @@ struct symbol *map_groups__find_symbol_by_name(struct map_groups *self,
173 struct map **mapp, 180 struct map **mapp,
174 symbol_filter_t filter); 181 symbol_filter_t filter);
175 182
176static inline struct symbol *machine__find_function(struct machine *self, 183static inline
177 u64 addr, struct map **mapp, 184struct symbol *machine__find_kernel_symbol(struct machine *self,
178 symbol_filter_t filter) 185 enum map_type type, u64 addr,
186 struct map **mapp,
187 symbol_filter_t filter)
188{
189 return map_groups__find_symbol(&self->kmaps, type, addr, mapp, filter);
190}
191
192static inline
193struct symbol *machine__find_kernel_function(struct machine *self, u64 addr,
194 struct map **mapp,
195 symbol_filter_t filter)
179{ 196{
180 return map_groups__find_symbol(&self->kmaps, MAP__FUNCTION, addr, mapp, filter); 197 return machine__find_kernel_symbol(self, MAP__FUNCTION, addr, mapp, filter);
181} 198}
182 199
183static inline 200static inline