diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-15 20:04:40 -0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-16 08:53:49 +0100 |
commit | 655000e7c75a559681ee7f15f6fa870c80ae3194 (patch) | |
tree | 69a56e19c818b0929dbea8d119fa133853c5ee80 /tools/perf/util | |
parent | 75be6cf48738aec68aac49b428423569492cfba3 (diff) | |
download | kernel_samsung_aries-655000e7c75a559681ee7f15f6fa870c80ae3194.zip kernel_samsung_aries-655000e7c75a559681ee7f15f6fa870c80ae3194.tar.gz kernel_samsung_aries-655000e7c75a559681ee7f15f6fa870c80ae3194.tar.bz2 |
perf symbols: Adopt the strlists for dso, comm
Will be used in perf diff too.
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: <1260914682-29652-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/symbol.c | 33 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 9 |
2 files changed, 42 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 17ce012..164286a 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1,6 +1,7 @@ #include "util.h" #include "../perf.h" #include "session.h" +#include "sort.h" #include "string.h" #include "symbol.h" #include "thread.h" @@ -1739,6 +1740,20 @@ out_fail: return -1; } +static int setup_list(struct strlist **list, const char *list_str, + const char *list_name) +{ + if (list_str == NULL) + return 0; + + *list = strlist__new(true, list_str); + if (!*list) { + pr_err("problems parsing %s list\n", list_name); + return -1; + } + return 0; +} + int symbol__init(void) { elf_version(EV_CURRENT); @@ -1749,7 +1764,25 @@ int symbol__init(void) if (symbol_conf.try_vmlinux_path && vmlinux_path__init() < 0) return -1; + if (setup_list(&symbol_conf.dso_list, + symbol_conf.dso_list_str, "dso") < 0) + return -1; + + if (setup_list(&symbol_conf.comm_list, + symbol_conf.comm_list_str, "comm") < 0) + goto out_free_dso_list; + + if (setup_list(&symbol_conf.sym_list, + symbol_conf.sym_list_str, "symbol") < 0) + goto out_free_comm_list; + return 0; + +out_free_dso_list: + strlist__delete(symbol_conf.dso_list); +out_free_comm_list: + strlist__delete(symbol_conf.comm_list); + return -1; } int perf_session__create_kernel_maps(struct perf_session *self) diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 7662947..d61f350 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -49,12 +49,21 @@ struct symbol { char name[0]; }; +struct strlist; + struct symbol_conf { unsigned short priv_size; bool try_vmlinux_path, use_modules, sort_by_name; const char *vmlinux_name; + char *dso_list_str, + *comm_list_str, + *sym_list_str, + *col_width_list_str; + struct strlist *dso_list, + *comm_list, + *sym_list; }; extern struct symbol_conf symbol_conf; |