linux-yocto/tools
Lorenzo Stoakes 8b09bb5c42 selftests/perf_events: Add a mmap() correctness test
commit 084d2ac403 upstream.

Exercise various mmap(), munmap() and mremap() invocations, which might
cause a perf buffer mapping to be split or truncated.

To avoid hard coding the perf event and having dependencies on
architectures and configuration options, scan through event types in sysfs
and try to open them. On success, try to mmap() and if that succeeds try to
mmap() the AUX buffer.

In case that no AUX buffer supporting event is found, only test the base
buffer mapping. If no mappable event is found or permissions are not
sufficient, skip the tests.

Reserve a PROT_NONE region for both rb and aux tests to allow testing the
case where mremap unmaps beyond the end of a mapped VMA to prevent it from
unmapping unrelated mappings.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Co-developed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-15 16:39:31 +02:00
..
accounting
arch x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-08 21:33:26 +02:00
bootconfig
bpf bpftool: Fix memory leak in dump_xx_nlmsg on realloc failure 2025-08-15 16:38:39 +02:00
build
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-08-15 16:38:50 +02:00
counter
crypto
debugging
firewire
firmware
gpio
hv tools/hv: fcopy: Fix irregularities with size of ring buffer 2025-07-15 06:25:33 +00:00
iio
include tools/nolibc: avoid false-positive -Wmaybe-uninitialized through waitpid() 2025-08-15 16:38:31 +02:00
kvm/kvm_stat
laptop
leds
lib tools subcmd: Tighten the filename size in check_if_command_finished 2025-08-15 16:39:11 +02:00
memory-model
mm
net tools: ynl: fix mixing ops and notifications on one socket 2025-06-19 08:37:39 -07:00
objtool Rust fixes for v6.16 (2nd) 2025-07-19 09:22:26 -07:00
pcmcia
perf perf record: Cache build-ID of hit DSOs only 2025-08-15 16:39:14 +02:00
power tools/power turbostat: Fix DMR support 2025-08-15 16:39:30 +02:00
rcu
sched_ext
scripts
sound
spi
testing selftests/perf_events: Add a mmap() correctness test 2025-08-15 16:39:31 +02:00
thermal
time
tracing tracing tools updates for v6.16: 2025-05-29 20:59:52 -07:00
usb
verification tools/rv: Do not skip idle in trace 2025-08-15 16:38:52 +02:00
virtio
wmi
workqueue
writeback
Makefile