aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-07-22 08:14:32 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-07-25 10:32:36 -0400
commit44f24cb3156a1e7d2b6bb501b7f6153aed08994c (patch)
tree4976180e4efe6296ab182d797a429fea8cc9378e /tools/perf/util/symbol.h
parent6654f5d8bdaa438b1e60dfeb90f9d46ca969c012 (diff)
perf symbols: Factor DSO symtab types to generic binary types
Adding interface to access DSOs so it could be used from another place. New DSO binary type is added - making current SYMTAB__* types more general: DSO_BINARY_TYPE__* = SYMTAB__* Following function is added to return path based on the specified binary type: dso__binary_type_file Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Arun Sharma <asharma@fb.com> Cc: Benjamin Redelings <benjamin.redelings@nescent.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Frank Ch. Eigler <fche@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Robert Richter <robert.richter@amd.com> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Ulrich Drepper <drepper@gmail.com> Link: http://lkml.kernel.org/r/1342959280-5361-10-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.h')
-rw-r--r--tools/perf/util/symbol.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index a884b99017f..dc474f07bb2 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -155,6 +155,21 @@ struct addr_location {
155 s32 cpu; 155 s32 cpu;
156}; 156};
157 157
158enum dso_binary_type {
159 DSO_BINARY_TYPE__KALLSYMS = 0,
160 DSO_BINARY_TYPE__GUEST_KALLSYMS,
161 DSO_BINARY_TYPE__JAVA_JIT,
162 DSO_BINARY_TYPE__DEBUGLINK,
163 DSO_BINARY_TYPE__BUILD_ID_CACHE,
164 DSO_BINARY_TYPE__FEDORA_DEBUGINFO,
165 DSO_BINARY_TYPE__UBUNTU_DEBUGINFO,
166 DSO_BINARY_TYPE__BUILDID_DEBUGINFO,
167 DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
168 DSO_BINARY_TYPE__GUEST_KMODULE,
169 DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
170 DSO_BINARY_TYPE__NOT_FOUND,
171};
172
158enum dso_kernel_type { 173enum dso_kernel_type {
159 DSO_TYPE_USER = 0, 174 DSO_TYPE_USER = 0,
160 DSO_TYPE_KERNEL, 175 DSO_TYPE_KERNEL,
@@ -173,13 +188,13 @@ struct dso {
173 struct rb_root symbol_names[MAP__NR_TYPES]; 188 struct rb_root symbol_names[MAP__NR_TYPES];
174 enum dso_kernel_type kernel; 189 enum dso_kernel_type kernel;
175 enum dso_swap_type needs_swap; 190 enum dso_swap_type needs_swap;
191 enum dso_binary_type symtab_type;
176 u8 adjust_symbols:1; 192 u8 adjust_symbols:1;
177 u8 has_build_id:1; 193 u8 has_build_id:1;
178 u8 hit:1; 194 u8 hit:1;
179 u8 annotate_warned:1; 195 u8 annotate_warned:1;
180 u8 sname_alloc:1; 196 u8 sname_alloc:1;
181 u8 lname_alloc:1; 197 u8 lname_alloc:1;
182 unsigned char symtab_type;
183 u8 sorted_by_name; 198 u8 sorted_by_name;
184 u8 loaded; 199 u8 loaded;
185 u8 build_id[BUILD_ID_SIZE]; 200 u8 build_id[BUILD_ID_SIZE];
@@ -253,21 +268,6 @@ size_t dso__fprintf_symbols_by_name(struct dso *dso,
253 enum map_type type, FILE *fp); 268 enum map_type type, FILE *fp);
254size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp); 269size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp);
255 270
256enum symtab_type {
257 SYMTAB__KALLSYMS = 0,
258 SYMTAB__GUEST_KALLSYMS,
259 SYMTAB__JAVA_JIT,
260 SYMTAB__DEBUGLINK,
261 SYMTAB__BUILD_ID_CACHE,
262 SYMTAB__FEDORA_DEBUGINFO,
263 SYMTAB__UBUNTU_DEBUGINFO,
264 SYMTAB__BUILDID_DEBUGINFO,
265 SYMTAB__SYSTEM_PATH_DSO,
266 SYMTAB__GUEST_KMODULE,
267 SYMTAB__SYSTEM_PATH_KMODULE,
268 SYMTAB__NOT_FOUND,
269};
270
271char dso__symtab_origin(const struct dso *dso); 271char dso__symtab_origin(const struct dso *dso);
272void dso__set_long_name(struct dso *dso, char *name); 272void dso__set_long_name(struct dso *dso, char *name);
273void dso__set_build_id(struct dso *dso, void *build_id); 273void dso__set_build_id(struct dso *dso, void *build_id);
@@ -304,4 +304,6 @@ bool symbol_type__is_a(char symbol_type, enum map_type map_type);
304 304
305size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp); 305size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
306 306
307int dso__binary_type_file(struct dso *dso, enum dso_binary_type type,
308 char *root_dir, char *file, size_t size);
307#endif /* __PERF_SYMBOL */ 309#endif /* __PERF_SYMBOL */