HomeFreeBSD

hwpmc: Skip GLOBAL_CTRL updates on stop_pmc().

Description

hwpmc: Skip GLOBAL_CTRL updates on stop_pmc().

After we wipe PMC configuration, including its local enable bit(s),
we don't really care about its global enable bit. Global enable bits
now may only be cleared by interrupt handler in case of error (sample
buffer overflow). Being set is actually a reset default for them.

This saves one WRMSR per process-scope PMC per context switch, that
is clearly visible in profiles.

MFC after: 1 month

(cherry picked from commit 326a8d3e085dda2b82c99cf1eb2997cb4dc99a71)

Details

Provenance
mavAuthored on Jun 2 2022, 10:20 PM
Parents
rGc4cafc24df30: libpmc: Prefer fixed counters in Intel event aliases.
Branches
Unknown
Tags
Unknown