diff options
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index a08e1cbcbbbd..b39f499e575a 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -2282,6 +2282,9 @@ static int setup_list(struct strlist **list, const char *list_str, | |||
2282 | 2282 | ||
2283 | int symbol__init(void) | 2283 | int symbol__init(void) |
2284 | { | 2284 | { |
2285 | if (symbol_conf.initialized) | ||
2286 | return 0; | ||
2287 | |||
2285 | elf_version(EV_CURRENT); | 2288 | elf_version(EV_CURRENT); |
2286 | if (symbol_conf.sort_by_name) | 2289 | if (symbol_conf.sort_by_name) |
2287 | symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - | 2290 | symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - |
@@ -2307,6 +2310,7 @@ int symbol__init(void) | |||
2307 | symbol_conf.sym_list_str, "symbol") < 0) | 2310 | symbol_conf.sym_list_str, "symbol") < 0) |
2308 | goto out_free_comm_list; | 2311 | goto out_free_comm_list; |
2309 | 2312 | ||
2313 | symbol_conf.initialized = true; | ||
2310 | return 0; | 2314 | return 0; |
2311 | 2315 | ||
2312 | out_free_dso_list: | 2316 | out_free_dso_list: |
@@ -2318,11 +2322,14 @@ out_free_comm_list: | |||
2318 | 2322 | ||
2319 | void symbol__exit(void) | 2323 | void symbol__exit(void) |
2320 | { | 2324 | { |
2325 | if (!symbol_conf.initialized) | ||
2326 | return; | ||
2321 | strlist__delete(symbol_conf.sym_list); | 2327 | strlist__delete(symbol_conf.sym_list); |
2322 | strlist__delete(symbol_conf.dso_list); | 2328 | strlist__delete(symbol_conf.dso_list); |
2323 | strlist__delete(symbol_conf.comm_list); | 2329 | strlist__delete(symbol_conf.comm_list); |
2324 | vmlinux_path__exit(); | 2330 | vmlinux_path__exit(); |
2325 | symbol_conf.sym_list = symbol_conf.dso_list = symbol_conf.comm_list = NULL; | 2331 | symbol_conf.sym_list = symbol_conf.dso_list = symbol_conf.comm_list = NULL; |
2332 | symbol_conf.initialized = false; | ||
2326 | } | 2333 | } |
2327 | 2334 | ||
2328 | int machines__create_kernel_maps(struct rb_root *self, pid_t pid) | 2335 | int machines__create_kernel_maps(struct rb_root *self, pid_t pid) |