Skip to content

Commit 56139d0

Browse files
tor-jeremiassenmathieupoirier
authored andcommitted
perf symbols: Check before overwriting build_id
Added check to see if has_build_id is set before overwriting build_id. Signed-off-by: Tor Jeremiassen <tor@ti.com>
1 parent 55ab378 commit 56139d0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tools/perf/util/symbol-minimal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ int dso__load_sym(struct dso *dso, struct map *map __maybe_unused,
344344
if (ret >= 0)
345345
dso->is_64_bit = ret;
346346

347-
if (filename__read_build_id(ss->name, build_id, BUILD_ID_SIZE) > 0) {
347+
if ((!dso->has_build_id) && (filename__read_build_id(ss->name, build_id, BUILD_ID_SIZE) > 0)) {
348348
dso__set_build_id(dso, build_id);
349349
}
350350
return 0;

tools/perf/util/symbol.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,8 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
14651465
* Read the build id if possible. This is required for
14661466
* DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
14671467
*/
1468-
if (filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0)
1468+
if ((!dso->has_build_id) &&
1469+
(filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0))
14691470
dso__set_build_id(dso, build_id);
14701471

14711472
/*

0 commit comments

Comments
 (0)