diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-11-20 17:51:27 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-21 08:11:33 -0500 |
commit | c338aee853db197e1855b393e6d6cc667784537f (patch) | |
tree | f97fea21c608a689144302b8dd78ef29bfaa5c88 /tools/perf/util/symbol.h | |
parent | 78075caad99dc36ec6ef5826b7a5273ea14295fc (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/symbol.h')
-rw-r--r-- | tools/perf/util/symbol.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 3d9d346d101b..7a129047c47d 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -64,6 +64,7 @@ struct dso { | |||
64 | u8 slen_calculated:1; | 64 | u8 slen_calculated:1; |
65 | u8 loaded:1; | 65 | u8 loaded:1; |
66 | u8 has_build_id:1; | 66 | u8 has_build_id:1; |
67 | u8 kernel:1; | ||
67 | unsigned char origin; | 68 | unsigned char origin; |
68 | u8 build_id[BUILD_ID_SIZE]; | 69 | u8 build_id[BUILD_ID_SIZE]; |
69 | u16 long_name_len; | 70 | u16 long_name_len; |
@@ -77,12 +78,8 @@ void dso__delete(struct dso *self); | |||
77 | 78 | ||
78 | struct symbol *dso__find_symbol(struct dso *self, u64 ip); | 79 | struct symbol *dso__find_symbol(struct dso *self, u64 ip); |
79 | 80 | ||
80 | int dsos__load_modules(void); | ||
81 | int dsos__load_modules_sym(symbol_filter_t filter); | ||
82 | struct dso *dsos__findnew(const char *name); | 81 | struct dso *dsos__findnew(const char *name); |
83 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); | 82 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); |
84 | int dso__load_kernel_sym(struct dso *self, symbol_filter_t filter, | ||
85 | int use_modules); | ||
86 | void dsos__fprintf(FILE *fp); | 83 | void dsos__fprintf(FILE *fp); |
87 | size_t dsos__fprintf_buildid(FILE *fp); | 84 | size_t dsos__fprintf_buildid(FILE *fp); |
88 | 85 | ||
@@ -96,8 +93,8 @@ int sysfs__read_build_id(const char *filename, void *bf, size_t size); | |||
96 | bool dsos__read_build_ids(void); | 93 | bool dsos__read_build_ids(void); |
97 | int build_id__sprintf(u8 *self, int len, char *bf); | 94 | int build_id__sprintf(u8 *self, int len, char *bf); |
98 | 95 | ||
99 | struct dso *dsos__load_kernel(void); | 96 | int kernel_maps__init(bool use_modules); |
100 | int load_kernel(symbol_filter_t filter, bool use_modules); | 97 | size_t kernel_maps__fprintf(FILE *fp); |
101 | 98 | ||
102 | void symbol__init(unsigned int priv_size); | 99 | void symbol__init(unsigned int priv_size); |
103 | 100 | ||