summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-04-29 15:25:23 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-29 15:25:23 -0300
commit5c0541d53ef3897494768decb09eb8f1087953a5 (patch)
tree38b8eab8e45a2d2265db64b131320e6baa43b984 /tools/perf/util/map.h
parent18acde52b83bd1c8e1d007db519f46d344aa13ed (diff)
downloadlinux-5c0541d53ef3897494768decb09eb8f1087953a5.tar.bz2
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 {
u64 start;
u64 end;
enum map_type type;
+ u32 priv;
u64 pgoff;
/* ip -> dso rip */
@@ -66,6 +67,12 @@ struct machine {
struct map *vmlinux_maps[MAP__NR_TYPES];
};
+static inline
+struct map *machine__kernel_map(struct machine *self, enum map_type type)
+{
+ return self->vmlinux_maps[type];
+}
+
static inline struct kmap *map__kmap(struct map *self)
{
return (struct kmap *)(self + 1);
@@ -173,11 +180,21 @@ struct symbol *map_groups__find_symbol_by_name(struct map_groups *self,
struct map **mapp,
symbol_filter_t filter);
-static inline struct symbol *machine__find_function(struct machine *self,
- u64 addr, struct map **mapp,
- symbol_filter_t filter)
+static inline
+struct symbol *machine__find_kernel_symbol(struct machine *self,
+ enum map_type type, u64 addr,
+ struct map **mapp,
+ symbol_filter_t filter)
+{
+ return map_groups__find_symbol(&self->kmaps, type, addr, mapp, filter);
+}
+
+static inline
+struct symbol *machine__find_kernel_function(struct machine *self, u64 addr,
+ struct map **mapp,
+ symbol_filter_t filter)
{
- return map_groups__find_symbol(&self->kmaps, MAP__FUNCTION, addr, mapp, filter);
+ return machine__find_kernel_symbol(self, MAP__FUNCTION, addr, mapp, filter);
}
static inline