aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c33
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
1743static 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
1742int symbol__init(void) 1757int 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
1781out_free_dso_list:
1782 strlist__delete(symbol_conf.dso_list);
1783out_free_comm_list:
1784 strlist__delete(symbol_conf.comm_list);
1785 return -1;
1753} 1786}
1754 1787
1755int perf_session__create_kernel_maps(struct perf_session *self) 1788int perf_session__create_kernel_maps(struct perf_session *self)