aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/dso.c
diff options
context:
space:
mode:
authorGravatar Jiri Olsa <jolsa@kernel.org> 2020-10-13 21:24:38 +0200
committerGravatar Arnaldo Carvalho de Melo <acme@redhat.com> 2020-10-14 09:25:36 -0300
commit39be8d0115b321ed2b28e43dca12c13ae7595f73 (patch)
treedc123dbec7fd9d53025854eb9e974b04efbdd11e /tools/perf/util/dso.c
parentperf tools: Pass build_id object to dso__set_build_id() (diff)
downloadlinux-39be8d0115b321ed2b28e43dca12c13ae7595f73.tar.gz
linux-39be8d0115b321ed2b28e43dca12c13ae7595f73.tar.bz2
linux-39be8d0115b321ed2b28e43dca12c13ae7595f73.zip
perf tools: Pass build_id object to dso__build_id_equal()
Passing build_id object to dso__build_id_equal(), so we can properly check build id with different size than sha1. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20201013192441.1299447-7-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dso.c')
-rw-r--r--tools/perf/util/dso.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 4415ce83150b..ca965845b35e 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -1332,9 +1332,10 @@ void dso__set_build_id(struct dso *dso, struct build_id *bid)
dso->has_build_id = 1;
}
-bool dso__build_id_equal(const struct dso *dso, u8 *build_id)
+bool dso__build_id_equal(const struct dso *dso, struct build_id *bid)
{
- return memcmp(dso->bid.data, build_id, sizeof(dso->bid.data)) == 0;
+ return dso->bid.size == bid->size &&
+ memcmp(dso->bid.data, bid->data, dso->bid.size) == 0;
}
void dso__read_running_kernel_build_id(struct dso *dso, struct machine *machine)