linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] perf: Set build-id using build-id header on new mmap records
@ 2022-03-04  9:09 James Clark
  2022-03-04  9:09 ` [PATCH v2 1/1] " James Clark
  2022-03-05 20:33 ` [PATCH v2 0/1] " Jiri Olsa
  0 siblings, 2 replies; 4+ messages in thread
From: James Clark @ 2022-03-04  9:09 UTC (permalink / raw)
  To: acme, linux-perf-users, coresight, olsajiri
  Cc: James Clark, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel

Changes since v1:
 * Add read lock around dso find
 * Bracket style fix

Hi,

We are seeing an issue with doing Coresight decode off target where
initially the correct dso from ~/.debug is used, but after a new thread
in the perf.data file is passed with its mmap record, the local version
of the dso is picked up instead. This happens if the binary exists in the
same path on both devices, for example /bin/ls.

Initially when parsing the build-ids in the header, the dso for /bin/ls
will be created, and the file will correctly point to
~/.debug/bin/ls/2f15ad836be3339dec0e2e6a3c637e08e48aacbd/elf, but for any
new threads or mmaps that are also for /bin/ls, they will not have a
build-id set so they point to /bin/ls on the local machine rather than the
debug folder.

To fix this I made it possible to look up which existing dsos have
build id's set that originate from the header and then copy that build-id
onto the new dso if the name matches. Another way to do it would
be to stop comparing the mmap id so it matches on filename only, but I
think we do want to differentiate between different mmaps, even if they
have the same name, which is how it works in this version.

Applies to perf/core 56dce8681

James Clark (1):
  perf: Set build-id using build-id header on new mmap records

 tools/perf/util/dso.h    |  1 +
 tools/perf/util/header.c |  1 +
 tools/perf/util/map.c    | 20 +++++++++++++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-12 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-04  9:09 [PATCH v2 0/1] perf: Set build-id using build-id header on new mmap records James Clark
2022-03-04  9:09 ` [PATCH v2 1/1] " James Clark
2022-03-05 20:33 ` [PATCH v2 0/1] " Jiri Olsa
2022-03-12 14:01   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).