mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
perf build-id: Mark DSO in sample callchains
Previously only the sample IP's map DSO would be marked hit for the purposes of populating the build ID cache. Walk the call chain to mark all IPs and DSOs. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250724163302.596743-5-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
fccaaf6fbb
commit
29be60c93d
|
|
@ -42,10 +42,20 @@
|
||||||
|
|
||||||
static bool no_buildid_cache;
|
static bool no_buildid_cache;
|
||||||
|
|
||||||
|
static int mark_dso_hit_callback(struct callchain_cursor_node *node, void *data __maybe_unused)
|
||||||
|
{
|
||||||
|
struct map *map = node->ms.map;
|
||||||
|
|
||||||
|
if (map)
|
||||||
|
dso__set_hit(map__dso(map));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int build_id__mark_dso_hit(const struct perf_tool *tool __maybe_unused,
|
int build_id__mark_dso_hit(const struct perf_tool *tool __maybe_unused,
|
||||||
union perf_event *event,
|
union perf_event *event,
|
||||||
struct perf_sample *sample,
|
struct perf_sample *sample,
|
||||||
struct evsel *evsel __maybe_unused,
|
struct evsel *evsel,
|
||||||
struct machine *machine)
|
struct machine *machine)
|
||||||
{
|
{
|
||||||
struct addr_location al;
|
struct addr_location al;
|
||||||
|
|
@ -63,6 +73,11 @@ int build_id__mark_dso_hit(const struct perf_tool *tool __maybe_unused,
|
||||||
dso__set_hit(map__dso(al.map));
|
dso__set_hit(map__dso(al.map));
|
||||||
|
|
||||||
addr_location__exit(&al);
|
addr_location__exit(&al);
|
||||||
|
|
||||||
|
sample__for_each_callchain_node(thread, evsel, sample, PERF_MAX_STACK_DEPTH,
|
||||||
|
/*symbols=*/false, mark_dso_hit_callback, /*data=*/NULL);
|
||||||
|
|
||||||
|
|
||||||
thread__put(thread);
|
thread__put(thread);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user