diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-15 17:04:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-16 02:53:49 -0500 |
commit | 655000e7c75a559681ee7f15f6fa870c80ae3194 (patch) | |
tree | 69a56e19c818b0929dbea8d119fa133853c5ee80 /tools/perf/util/symbol.c | |
parent | 75be6cf48738aec68aac49b428423569492cfba3 (diff) |
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/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 17ce01269a91..164286ace7df 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "util.h" | 1 | #include "util.h" |
2 | #include "../perf.h" | 2 | #include "../perf.h" |
3 | #include "session.h" | 3 | #include "session.h" |
4 | #include "sort.h" | ||
4 | #include "string.h" | 5 | #include "string.h" |
5 | #include "symbol.h" | 6 | #include "symbol.h" |
6 | #include "thread.h" | 7 | #include "thread.h" |
@@ -1739,6 +1740,20 @@ out_fail: | |||
1739 | return -1; | 1740 | return -1; |
1740 | } | 1741 | } |
1741 | 1742 | ||
1743 | static int setup_list(struct strlist **list, const char *list_str, | ||
1744 | const char *list_name) | ||
1745 | { | ||
1746 | if (list_str == NULL) | ||
1747 | return 0; | ||
1748 | |||
1749 | *list = strlist__new(true, list_str); | ||
1750 | if (!*list) { | ||
1751 | pr_err("problems parsing %s list\n", list_name); | ||
1752 | return -1; | ||
1753 | } | ||
1754 | return 0; | ||
1755 | } | ||
1756 | |||
1742 | int symbol__init(void) | 1757 | int symbol__init(void) |
1743 | { | 1758 | { |
1744 | elf_version(EV_CURRENT); | 1759 | elf_version(EV_CURRENT); |
@@ -1749,7 +1764,25 @@ int symbol__init(void) | |||
1749 | if (symbol_conf.try_vmlinux_path && vmlinux_path__init() < 0) | 1764 | if (symbol_conf.try_vmlinux_path && vmlinux_path__init() < 0) |
1750 | return -1; | 1765 | return -1; |
1751 | 1766 | ||
1767 | if (setup_list(&symbol_conf.dso_list, | ||
1768 | symbol_conf.dso_list_str, "dso") < 0) | ||
1769 | return -1; | ||
1770 | |||
1771 | if (setup_list(&symbol_conf.comm_list, | ||
1772 | symbol_conf.comm_list_str, "comm") < 0) | ||
1773 | goto out_free_dso_list; | ||
1774 | |||
1775 | if (setup_list(&symbol_conf.sym_list, | ||
1776 | symbol_conf.sym_list_str, "symbol") < 0) | ||
1777 | goto out_free_comm_list; | ||
1778 | |||
1752 | return 0; | 1779 | return 0; |
1780 | |||
1781 | out_free_dso_list: | ||
1782 | strlist__delete(symbol_conf.dso_list); | ||
1783 | out_free_comm_list: | ||
1784 | strlist__delete(symbol_conf.comm_list); | ||
1785 | return -1; | ||
1753 | } | 1786 | } |
1754 | 1787 | ||
1755 | int perf_session__create_kernel_maps(struct perf_session *self) | 1788 | int perf_session__create_kernel_maps(struct perf_session *self) |