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>
This commit is contained in:
tor-jeremiassen 2016-02-17 08:29:21 -06:00 committed by Mathieu Poirier
parent 55ab378629
commit 56139d02e2
2 changed files with 3 additions and 2 deletions

View File

@ -344,7 +344,7 @@ int dso__load_sym(struct dso *dso, struct map *map __maybe_unused,
if (ret >= 0)
dso->is_64_bit = ret;
if (filename__read_build_id(ss->name, build_id, BUILD_ID_SIZE) > 0) {
if ((!dso->has_build_id) && (filename__read_build_id(ss->name, build_id, BUILD_ID_SIZE) > 0)) {
dso__set_build_id(dso, build_id);
}
return 0;

View File

@ -1465,7 +1465,8 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
* Read the build id if possible. This is required for
* DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
*/
if (filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0)
if ((!dso->has_build_id) &&
(filename__read_build_id(dso->name, build_id, BUILD_ID_SIZE) > 0))
dso__set_build_id(dso, build_id);
/*