summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortor-jeremiassen <tor@ti.com>2016-02-17 08:29:21 -0600
committerMathieu Poirier <mathieu.poirier@linaro.org>2016-06-20 11:16:05 -0600
commit56139d02e29f968d349571850e832da942ff516b (patch)
treeb57f665813f6ec131ee021470a40ceced9a7438c
parent55ab3786296f490cc921a1acc244dc6c22c37201 (diff)
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>
-rw-r--r--tools/perf/util/symbol-minimal.c2
-rw-r--r--tools/perf/util/symbol.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index 48906333a858..9be16712ce74 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -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;
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index cd08027a6d2c..1d0d8bff4a5b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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);
/*