Re: [PATCH v3 0/7] perf synthetic-events: Use PROCMAP_QUERY for mmap synthesis

From: Peter Zijlstra

Date: Fri Dec 04 2026 - 06:12:06 EST


On Thu, Dec 03, 2026 at 10:23:21PM -0800, Ian Rogers wrote:

> Patch 5 adds the PROCMAP_QUERY path. Without data mmaps the kernel
> returns only executable VMAs. With data mmaps (readable or executable
> VMAs are wanted) a first pass gets readable VMAs, skipping guard pages,
> and a second pass gets executable VMAs that aren't readable, such as
> execute-only memory. The DSO cache is consulted first (keyed by
> device/inode as before), and only on a miss is the VMA queried again
> for the kernel to read the build ID, so each file's build ID is read
> once. If the kernel can't give a build ID, the file is read as before,
> with the existing nsinfo handling; no nsinfo or mount namespace work
> is done when the kernel or DSO cache provides the build ID. The text
> parser remains as a fallback when the ioctl isn't supported (probed
> once with pthread_once()) or the first query fails. Shared code is in
> a helper so both paths emit identical events.


> The 3 thread PROCMAP_QUERY median is skewed by two noisy runs; by the
> minimum it is 43% faster.

Nice :-)