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.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 651dbfe7f4f3..f06c10f092ba 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1196,6 +1196,8 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
1196 if (curr_dso == NULL) 1196 if (curr_dso == NULL)
1197 goto out_elf_end; 1197 goto out_elf_end;
1198 curr_dso->kernel = self->kernel; 1198 curr_dso->kernel = self->kernel;
1199 curr_dso->long_name = self->long_name;
1200 curr_dso->long_name_len = self->long_name_len;
1199 curr_map = map__new2(start, curr_dso, 1201 curr_map = map__new2(start, curr_dso,
1200 map->type); 1202 map->type);
1201 if (curr_map == NULL) { 1203 if (curr_map == NULL) {
@@ -1486,7 +1488,9 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1486 * On the first pass, only load images if they have a full symtab. 1488 * On the first pass, only load images if they have a full symtab.
1487 * Failing that, do a second pass where we accept .dynsym also 1489 * Failing that, do a second pass where we accept .dynsym also
1488 */ 1490 */
1489 for (self->symtab_type = SYMTAB__BUILD_ID_CACHE, want_symtab = 1; 1491 want_symtab = 1;
1492restart:
1493 for (self->symtab_type = SYMTAB__BUILD_ID_CACHE;
1490 self->symtab_type != SYMTAB__NOT_FOUND; 1494 self->symtab_type != SYMTAB__NOT_FOUND;
1491 self->symtab_type++) { 1495 self->symtab_type++) {
1492 switch (self->symtab_type) { 1496 switch (self->symtab_type) {
@@ -1536,17 +1540,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1536 snprintf(name, size, "%s%s", symbol_conf.symfs, 1540 snprintf(name, size, "%s%s", symbol_conf.symfs,
1537 self->long_name); 1541 self->long_name);
1538 break; 1542 break;
1539 1543 default:;
1540 default:
1541 /*
1542 * If we wanted a full symtab but no image had one,
1543 * relax our requirements and repeat the search.
1544 */
1545 if (want_symtab) {
1546 want_symtab = 0;
1547 self->symtab_type = SYMTAB__BUILD_ID_CACHE;
1548 } else
1549 continue;
1550 } 1544 }
1551 1545
1552 /* Name is now the name of the next image to try */ 1546 /* Name is now the name of the next image to try */
@@ -1573,6 +1567,15 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1573 } 1567 }
1574 } 1568 }
1575 1569
1570 /*
1571 * If we wanted a full symtab but no image had one,
1572 * relax our requirements and repeat the search.
1573 */
1574 if (ret <= 0 && want_symtab) {
1575 want_symtab = 0;
1576 goto restart;
1577 }
1578
1576 free(name); 1579 free(name);
1577 if (ret < 0 && strstr(self->name, " (deleted)") != NULL) 1580 if (ret < 0 && strstr(self->name, " (deleted)") != NULL)
1578 return 0; 1581 return 0;
@@ -1841,6 +1844,7 @@ int dso__load_vmlinux(struct dso *self, struct map *map,
1841 if (fd < 0) 1844 if (fd < 0)
1842 return -1; 1845 return -1;
1843 1846
1847 dso__set_long_name(self, (char *)vmlinux);
1844 dso__set_loaded(self, map->type); 1848 dso__set_loaded(self, map->type);
1845 err = dso__load_sym(self, map, symfs_vmlinux, fd, filter, 0, 0); 1849 err = dso__load_sym(self, map, symfs_vmlinux, fd, filter, 0, 0);
1846 close(fd); 1850 close(fd);
@@ -2402,6 +2406,8 @@ int symbol__init(void)
2402 if (symbol_conf.initialized) 2406 if (symbol_conf.initialized)
2403 return 0; 2407 return 0;
2404 2408
2409 symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
2410
2405 elf_version(EV_CURRENT); 2411 elf_version(EV_CURRENT);
2406 if (symbol_conf.sort_by_name) 2412 if (symbol_conf.sort_by_name)
2407 symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - 2413 symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -