aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-20 17:51:27 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-21 08:11:33 -0500
commitc338aee853db197e1855b393e6d6cc667784537f (patch)
treef97fea21c608a689144302b8dd78ef29bfaa5c88 /tools/perf/util/map.c
parent78075caad99dc36ec6ef5826b7a5273ea14295fc (diff)
perf symbols: Do lazy symtab loading for the kernel & modules too
Just like we do with the other DSOs. This also simplifies the kernel_maps setup process, now all that the tools need to do is to call kernel_maps__init and the maps for the modules and kernel will be created, then, later, when kernel_maps__find_symbol() is used, it will also call maps__find_symbol that already checks if the symtab was loaded, loading it if needed. Now if one does 'perf top --hide_kernel_symbols' we won't pay the price of loading the (many) symbols in /proc/kallsyms or vmlinux. 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: <1258757489-5978-4-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 94ca95073c40..09412321a80d 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -75,6 +75,29 @@ out_delete:
75 return NULL; 75 return NULL;
76} 76}
77 77
78void map__delete(struct map *self)
79{
80 free(self);
81}
82
83void map__fixup_start(struct map *self)
84{
85 struct rb_node *nd = rb_first(&self->dso->syms);
86 if (nd != NULL) {
87 struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
88 self->start = sym->start;
89 }
90}
91
92void map__fixup_end(struct map *self)
93{
94 struct rb_node *nd = rb_last(&self->dso->syms);
95 if (nd != NULL) {
96 struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
97 self->end = sym->end;
98 }
99}
100
78#define DSO__DELETED "(deleted)" 101#define DSO__DELETED "(deleted)"
79 102
80struct symbol * 103struct symbol *