哈希:
3c3f886e4bc7619f7847ad0d0f996088ddf5915a
作者:Alexander Leidinger <netchild@FreeBSD.org>
提交者:Alexander Leidinger <netchild@FreeBSD.org>
提交时间:2026-07-20 18:24:55 +0800
提交信息:
hwpmc: add regression tests for detaching a live process-mode PMC
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).
Reviewed by: adrian
MFC after: 2 weeks
Assisted-by: Claude Code (Fable 5)
Differential Revision:
https://reviews.freebsd.org/D58343