Page MenuHomeFreeBSD

hwpmc: add regression tests for detaching a live process-mode PMC
ClosedPublic

Authored by netchild on Jul 19 2026, 12:26 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Aug 30, 1:06 PM
Unknown Object (File)
Sun, Aug 30, 1:02 PM
Unknown Object (File)
Sun, Aug 30, 12:07 PM
Unknown Object (File)
Sun, Aug 30, 12:03 PM
Unknown Object (File)
Sun, Aug 30, 7:12 AM
Unknown Object (File)
Fri, Aug 28, 3:06 AM
Unknown Object (File)
Fri, Aug 28, 3:02 AM
Unknown Object (File)
Wed, Aug 26, 7:14 PM
Subscribers

Details

Summary

Attach a process-mode counting PMC to the current process, start it,
then detach and release it while it is still loaded on the hardware -
the case that previously leaked the PMC's runcount reference and
wedged pmc_wait_for_pmc_idle() at release. A second case does the same
from a multi-threaded process so the sibling threads' references have
to be drained too.

The tests need an allocatable process-mode counting event and skip
where none is available (hwpmc(4) not loaded, or a VM without a vPMU).

MFC after: 2 weeks
Assisted-by: Claude Code (Fable 5)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable