Hello, I'm using perf to measure my LLVM jitted code performance. However, I found with some condition, perf will unable to resolve or annotate JIT symbols. After some debugging, I found the cause is mprotect() combined two adjacent vma, and report a MMAP2 event of merged vma, confusing perf. I wrote a sample program (sample.c). It creates function computing factorial. First it creates test1() and exec it for 10000 times. Then, it creates test2() and exec both test1() and test2() for 10000 times respectively. As a result, test1() was executed 20000 times, and test2() was executed 10000 times. However, perf report shows: 33.33% a.out jitted-10742-3.so [.] test2 33.30% a.out jitted-10742-2.so [.] test1 33.26% a.out [JIT] tid 10742 [.] 0x00007f4b8cb3d010 // test1 This is because LLVM create jitted code by using mmap() and mprotect(): (the address is different because of ASLR) //// compile test1 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fca1a491000 mprotect(0x7fca1a491000, 4096, PROT_READ|PROT_EXEC) = 0 //// compile test2 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fca1a490000 mprotect(0x7fca1a490000, 4096, PROT_READ|PROT_EXEC) = 0 The second mprotect will merge two adjacent vma, and report a MMAP2 event of merged vma. The pref tool saw this: 9547033496331 0x2510 [0x60]: PERF_RECORD_MMAP2 10742/10742: [0x7f4b8cb3d000(0x2000) @ 0x7f4b8cb3d000 00:00 0 0]: r-xp //anon 9547033524086 0xf00 [0xb0]: PERF_RECORD_MMAP2 10742/10742: [0x7f4b8cb3d000(0x18) @ 0x40 08:02 10224200 1]: --xs /home/zby/src/qemuproject/qemu/.debug/jit/llvm-IR-jit-20210109-ad4573/jitted-10742-2.so 9553628266188 0x103898 [0x60]: PERF_RECORD_MMAP2 10742/10742: [0x7f4b8cb3c000(0x3000) @ 0x7f4b8cb3c000 00:00 0 0]: r-xp //anon 9553628283472 0xfb0 [0xb0]: PERF_RECORD_MMAP2 10742/10742: [0x7f4b8cb3c000(0x18) @ 0x40 08:02 10224201 1]: --xs /home/zby/src/qemuproject/qemu/.debug/jit/llvm-IR-jit-20210109-ad4573/jitted-10742-3.so The event of third line, confusing perf, make it thinks test1() had disappear. Then perf if unable to resolve test1() or annotate it. Thank you very much! Zhang Boyang