]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf jitdump: Directly mark the jitdump DSO
authorIan Rogers <irogers@google.com>
Thu, 24 Jul 2025 16:32:47 +0000 (09:32 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 25 Jul 2025 17:37:56 +0000 (10:37 -0700)
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>
tools/perf/util/jitdump.c

index 624964f01b5f75304675e65beee2085682f9a633..b062b1f234b62dd8d4f9e916bcc4f8beb7458b9a 100644 (file)
@@ -14,9 +14,9 @@
 #include <sys/mman.h>
 #include <linux/stringify.h>
 
-#include "build-id.h"
 #include "event.h"
 #include "debug.h"
+#include "dso.h"
 #include "evlist.h"
 #include "namespaces.h"
 #include "symbol.h"
@@ -531,9 +531,22 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
        /*
         * mark dso as use to generate buildid in the header
         */
-       if (!ret)
-               build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine);
-
+       if (!ret) {
+               struct dso_id dso_id = {
+                       {
+                               .maj = event->mmap2.maj,
+                               .min = event->mmap2.min,
+                               .ino = event->mmap2.ino,
+                               .ino_generation = event->mmap2.ino_generation,
+                       },
+                       .mmap2_valid = true,
+                       .mmap2_ino_generation_valid = true,
+               };
+               struct dso *dso = machine__findnew_dso_id(jd->machine, filename, &dso_id);
+
+               if (dso)
+                       dso__set_hit(dso);
+       }
 out:
        perf_sample__exit(&sample);
        free(event);