HomeFreeBSD

hwpmc: improve diagnostic messages for invalid tunables

Description

hwpmc: improve diagnostic messages for invalid tunables

Replace printf() with log(LOG_WARNING, ...) in pmclog_initialize()
so that tunable validation failures are visible in dmesg and
/var/log/messages rather than only on the early console.

Also improve the messages to report both the invalid value and the
default it resets to, making it easier for users to understand why
their tunable was ignored.

While here, adjust some whitespacing/style.

Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne
MFC after: 1 week
Sponsored by: NLINK (nlink.com.br)
Differential Revision: https://reviews.freebsd.org/D56029

(cherry picked from commit b3a18736ec2fc2bd097995dedd8d09e79bcb2056)

Details

Provenance
paulo_nlink.com.brAuthored on Mar 23 2026, 2:54 PM
mhorneCommitted on Apr 16 2026, 3:18 PM
Reviewer
mhorne
Differential Revision
D56029: hwpmc: improve diagnostic messages for invalid tunables
Parents
rG928091964581: hwpmc.4: correct stale default values and update diagnostics
Branches
Unknown
Tags
Unknown