aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-24 09:05:15 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-24 10:37:02 -0500
commitb32d133aec5dc882cf783a293f393bfb3f4379e1 (patch)
tree41fc56a4aaec8892a235ffd530b36278d147dc4e /tools/perf/util/symbol.h
parent7cc017edb9459193d3b581155a14029e4bef0c49 (diff)
perf symbols: Simplify symbol machinery setup
And also express its configuration toggles via a struct. Now all one has to do is to call symbol__init(NULL) if the defaults are OK, or pass a struct symbol_conf pointer with the desired configuration. If a tool uses kernel_maps__find_symbol() to look at the kernel and modules mappings for a symbol but didn't call symbol__init() first, that will generate a one time warning too, alerting the subcommand developer that symbol__init() must be called. 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: <1259071517-3242-2-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.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 8c4d026e067a..5538691494af 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -49,6 +49,13 @@ struct symbol {
49 char name[0]; 49 char name[0];
50}; 50};
51 51
52struct symbol_conf {
53 unsigned short priv_size;
54 bool try_vmlinux_path,
55 use_modules;
56 const char *vmlinux_name;
57};
58
52extern unsigned int symbol__priv_size; 59extern unsigned int symbol__priv_size;
53 60
54static inline void *symbol__priv(struct symbol *self) 61static inline void *symbol__priv(struct symbol *self)
@@ -93,11 +100,9 @@ int sysfs__read_build_id(const char *filename, void *bf, size_t size);
93bool dsos__read_build_ids(void); 100bool dsos__read_build_ids(void);
94int build_id__sprintf(u8 *self, int len, char *bf); 101int build_id__sprintf(u8 *self, int len, char *bf);
95 102
96int kernel_maps__init(const char *vmlinux_name, bool try_vmlinux_path,
97 bool use_modules);
98size_t kernel_maps__fprintf(FILE *fp); 103size_t kernel_maps__fprintf(FILE *fp);
99 104
100void symbol__init(unsigned int priv_size); 105int symbol__init(struct symbol_conf *conf);
101 106
102extern struct list_head dsos; 107extern struct list_head dsos;
103extern struct map *kernel_map; 108extern struct map *kernel_map;