Skip to content

Commit 5b11409

Browse files
captain5050namhyung
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent d9f2ecb commit 5b11409

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

tools/perf/util/jitdump.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <sys/mman.h>
1515
#include <linux/stringify.h>
1616

17-
#include "build-id.h"
1817
#include "event.h"
1918
#include "debug.h"
19+
#include "dso.h"
2020
#include "evlist.h"
2121
#include "namespaces.h"
2222
#include "symbol.h"
@@ -531,9 +531,22 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
531531
/*
532532
* mark dso as use to generate buildid in the header
533533
*/
534-
if (!ret)
535-
build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine);
536-
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);
546+
547+
if (dso)
548+
dso__set_hit(dso);
549+
}
537550
out:
538551
perf_sample__exit(&sample);
539552
free(event);

0 commit comments

Comments
 (0)