]> git.itanic.dy.fi Git - linux-stable/commit
perf unwind-libdw: Handle JIT-generated DSOs properly
authorNamhyung Kim <namhyung@kernel.org>
Tue, 12 Dec 2023 07:05:45 +0000 (23:05 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Dec 2023 22:08:48 +0000 (19:08 -0300)
commitc966d23a351a33f8a977fd7efbb6f467132f7383
tree0e1025b493da6694e8e15f928cc0f650a9f36161
parent1af478903fc48c1409a8dd6b698383b62387adf1
perf unwind-libdw: Handle JIT-generated DSOs properly

Usually DSOs are mapped from the beginning of the file, so the base
address of the DSO can be calculated by map->start - map->pgoff.

However, JIT DSOs which are generated by `perf inject -j`, are mapped
only the code segment.  This makes unwind-libdw code confusing and
rejects processing unwinds in the JIT DSOs.  It should use the map
start address as base for them to fix the confusion.

Fixes: 1fe627da30331024 ("perf unwind: Take pgoff into account when reporting elf to libdwfl")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Fangrui Song <maskray@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Pablo Galindo <pablogsal@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231212070547.612536-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/unwind-libdw.c