In a guest without a PMU, hwpmc(4) registers only the SOFT class, but
the "instructions" alias still resolves from the pmu-events tables, so
pmc_allocate() fails with EINVAL. pmc_ss_test checked only the alias
and getmsr_refusals required the allocation, so both failed in CI
instead of skipping.
Probe the allocation the tests make and skip if it fails, as
rdpmc_reads_own_counter already does.
The PR names 7c743e3ba6c1, but the three failing cases come from
d546356523f3. CI build 29966 tested ee9e945e7c59, which predates
7c743e3ba6c1. The tests added in 7c743e3ba6c1 check for an AMD CPU
first and skip on the Intel CI guest.
PR: 300856 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300856)
Fixes: d546356523f3 ("tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests")
Reported by: ngie
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>