From f693dac4794fae99c04f75a3a1a5c4018bb33144 Mon Sep 17 00:00:00 2001 From: James Clark Date: Fri, 4 Mar 2022 09:09:56 +0000 Subject: perf tools: Set build-id using build-id header on new mmap records MMAP records that occur after the build-id header is parsed do not have their build-id set even if the filename matches an entry from the header. Set the build-id on these dsos as long as the MMAP record doesn't have its own build-id set. This fixes an issue with off target analysis where the local version of a dso is loaded rather than one from ~/.debug via a build-id. Reported-by: Denis Nikitin Signed-off-by: James Clark Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220304090956.2048712-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/header.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/perf/util/header.c') diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 6da12e522edc..571d73d4f976 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2200,6 +2200,7 @@ static int __event_process_build_id(struct perf_record_header_build_id *bev, build_id__init(&bid, bev->data, size); dso__set_build_id(dso, &bid); + dso->header_build_id = 1; if (dso_space != DSO_SPACE__USER) { struct kmod_path m = { .name = NULL, }; -- cgit v1.2.3