diff options
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 96bff0e54863..aaa51ba147df 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <sys/param.h> | 11 | #include <sys/param.h> |
12 | #include <fcntl.h> | 12 | #include <fcntl.h> |
13 | #include <unistd.h> | 13 | #include <unistd.h> |
14 | #include "build-id.h" | ||
14 | #include "symbol.h" | 15 | #include "symbol.h" |
15 | #include "strlist.h" | 16 | #include "strlist.h" |
16 | 17 | ||
@@ -1293,7 +1294,6 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1293 | int size = PATH_MAX; | 1294 | int size = PATH_MAX; |
1294 | char *name; | 1295 | char *name; |
1295 | u8 build_id[BUILD_ID_SIZE]; | 1296 | u8 build_id[BUILD_ID_SIZE]; |
1296 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; | ||
1297 | int ret = -1; | 1297 | int ret = -1; |
1298 | int fd; | 1298 | int fd; |
1299 | struct machine *machine; | 1299 | struct machine *machine; |
@@ -1325,15 +1325,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1325 | } | 1325 | } |
1326 | 1326 | ||
1327 | self->origin = DSO__ORIG_BUILD_ID_CACHE; | 1327 | self->origin = DSO__ORIG_BUILD_ID_CACHE; |
1328 | 1328 | if (dso__build_id_filename(self, name, size) != NULL) | |
1329 | if (self->has_build_id) { | ||
1330 | build_id__sprintf(self->build_id, sizeof(self->build_id), | ||
1331 | build_id_hex); | ||
1332 | snprintf(name, size, "%s/%s/.build-id/%.2s/%s", | ||
1333 | getenv("HOME"), DEBUG_CACHE_DIR, | ||
1334 | build_id_hex, build_id_hex + 2); | ||
1335 | goto open_file; | 1329 | goto open_file; |
1336 | } | ||
1337 | more: | 1330 | more: |
1338 | do { | 1331 | do { |
1339 | self->origin++; | 1332 | self->origin++; |
@@ -1349,6 +1342,7 @@ more: | |||
1349 | case DSO__ORIG_BUILDID: | 1342 | case DSO__ORIG_BUILDID: |
1350 | if (filename__read_build_id(self->long_name, build_id, | 1343 | if (filename__read_build_id(self->long_name, build_id, |
1351 | sizeof(build_id))) { | 1344 | sizeof(build_id))) { |
1345 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; | ||
1352 | build_id__sprintf(build_id, sizeof(build_id), | 1346 | build_id__sprintf(build_id, sizeof(build_id), |
1353 | build_id_hex); | 1347 | build_id_hex); |
1354 | snprintf(name, size, | 1348 | snprintf(name, size, |