Page MenuHomeFreeBSD

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

Authored by netchild on Sun, Jul 19, 12:26 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Jul 26, 10:09 AM
Unknown Object (File)
Sun, Jul 26, 4:05 AM
Unknown Object (File)
Sun, Jul 26, 3:48 AM
Unknown Object (File)
Sat, Jul 25, 10:58 PM
Unknown Object (File)
Sat, Jul 25, 7:22 PM
Unknown Object (File)
Sat, Jul 25, 7:02 PM
Unknown Object (File)
Sat, Jul 25, 5:29 PM
Unknown Object (File)
Sat, Jul 25, 9:10 AM
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