Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf jitdump: Directly mark the jitdump DSO

The DSO being generated was being accessed through a thread's maps,
this is unnecessary as the dso can just be directly found. This avoids
problems with passing a NULL evsel which may be inspected to determine
properties of a callchain when using the buildid DSO marking code.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250724163302.596743-8-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
5b11409b d9f2ecbc

+16 -3
+16 -3
tools/perf/util/jitdump.c
··· 14 14 #include <sys/mman.h> 15 15 #include <linux/stringify.h> 16 16 17 - #include "build-id.h" 18 17 #include "event.h" 19 18 #include "debug.h" 19 + #include "dso.h" 20 20 #include "evlist.h" 21 21 #include "namespaces.h" 22 22 #include "symbol.h" ··· 531 531 /* 532 532 * mark dso as use to generate buildid in the header 533 533 */ 534 - if (!ret) 535 - build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine); 534 + if (!ret) { 535 + struct dso_id dso_id = { 536 + { 537 + .maj = event->mmap2.maj, 538 + .min = event->mmap2.min, 539 + .ino = event->mmap2.ino, 540 + .ino_generation = event->mmap2.ino_generation, 541 + }, 542 + .mmap2_valid = true, 543 + .mmap2_ino_generation_valid = true, 544 + }; 545 + struct dso *dso = machine__findnew_dso_id(jd->machine, filename, &dso_id); 536 546 547 + if (dso) 548 + dso__set_hit(dso); 549 + } 537 550 out: 538 551 perf_sample__exit(&sample); 539 552 free(event);