ptwrite uprobes v2
From: Andi Kleen
Date: Thu Sep 17 2026 - 21:26:38 EST
uprobes currently always require entering the kernel to log anything.
While that works well, it is rather slow.
Modern Intel CPUs have the ptwrite instruction, which can log data to
the Processor Trace buffer without entering the kernel.
This patch adds support in uprobes to patch in ptwrites instead of
the normal probes. If a user collects Processor Trace with perf
the logged data will appear in the PT log, otherwise the instructions
will be nops.
The benefit is much faster logging, but it also has a lot of
limitations. There is little filtering (other than what perf or
PT can do), no EBPF, there are restrictions on what can be logged,
and of course it depends on PT being recorded.
For more details and performance numbers see the Documentation patch,
but it's multiple orders of magnitude faster than classic uprobes.
This is v2 of the patchkit with various cleanups, fixes, simplifications.
It fixes the VMA iterator bug that caused crashes, as well
as addressing a lot of Sashiko feedback.
I stripped it down to only the minimal kernel code without the
user tools with minimal dependencies. The fault handling is deferred
for now.
Comments welcome.