diff options
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index aaa51ba147df..7fd6b151feb5 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1695,9 +1695,20 @@ int dso__load_vmlinux_path(struct dso *self, struct map *map, | |||
1695 | symbol_filter_t filter) | 1695 | symbol_filter_t filter) |
1696 | { | 1696 | { |
1697 | int i, err = 0; | 1697 | int i, err = 0; |
1698 | char *filename; | ||
1698 | 1699 | ||
1699 | pr_debug("Looking at the vmlinux_path (%d entries long)\n", | 1700 | pr_debug("Looking at the vmlinux_path (%d entries long)\n", |
1700 | vmlinux_path__nr_entries); | 1701 | vmlinux_path__nr_entries + 1); |
1702 | |||
1703 | filename = dso__build_id_filename(self, NULL, 0); | ||
1704 | if (filename != NULL) { | ||
1705 | err = dso__load_vmlinux(self, map, filename, filter); | ||
1706 | if (err > 0) { | ||
1707 | dso__set_long_name(self, filename); | ||
1708 | goto out; | ||
1709 | } | ||
1710 | free(filename); | ||
1711 | } | ||
1701 | 1712 | ||
1702 | for (i = 0; i < vmlinux_path__nr_entries; ++i) { | 1713 | for (i = 0; i < vmlinux_path__nr_entries; ++i) { |
1703 | err = dso__load_vmlinux(self, map, vmlinux_path[i], filter); | 1714 | err = dso__load_vmlinux(self, map, vmlinux_path[i], filter); |
@@ -1706,7 +1717,7 @@ int dso__load_vmlinux_path(struct dso *self, struct map *map, | |||
1706 | break; | 1717 | break; |
1707 | } | 1718 | } |
1708 | } | 1719 | } |
1709 | 1720 | out: | |
1710 | return err; | 1721 | return err; |
1711 | } | 1722 | } |
1712 | 1723 | ||
@@ -2102,13 +2113,21 @@ out_fail: | |||
2102 | return -1; | 2113 | return -1; |
2103 | } | 2114 | } |
2104 | 2115 | ||
2105 | size_t vmlinux_path__fprintf(FILE *fp) | 2116 | size_t machine__fprintf_vmlinux_path(struct machine *self, FILE *fp) |
2106 | { | 2117 | { |
2107 | int i; | 2118 | int i; |
2108 | size_t printed = 0; | 2119 | size_t printed = 0; |
2120 | struct dso *kdso = self->vmlinux_maps[MAP__FUNCTION]->dso; | ||
2121 | |||
2122 | if (kdso->has_build_id) { | ||
2123 | char filename[PATH_MAX]; | ||
2124 | if (dso__build_id_filename(kdso, filename, sizeof(filename))) | ||
2125 | printed += fprintf(fp, "[0] %s\n", filename); | ||
2126 | } | ||
2109 | 2127 | ||
2110 | for (i = 0; i < vmlinux_path__nr_entries; ++i) | 2128 | for (i = 0; i < vmlinux_path__nr_entries; ++i) |
2111 | printed += fprintf(fp, "[%d] %s\n", i, vmlinux_path[i]); | 2129 | printed += fprintf(fp, "[%d] %s\n", |
2130 | i + kdso->has_build_id, vmlinux_path[i]); | ||
2112 | 2131 | ||
2113 | return printed; | 2132 | return printed; |
2114 | } | 2133 | } |