HomeFreeBSD

libkvm: Fix kvm_getloadavg() on modern kernel vmcores

Description

libkvm: Fix kvm_getloadavg() on modern kernel vmcores

Fix kvm_getloadavg() to work correctly on vmcores for modern kernel
versions. The kernels no longer include the _fscale symbol causing
the kvm_nlist() invocation to fail. The code seemed to already assume
that _fscale could be missing but the early kvm_nlist() result check
has caused the function to fail if any symbol were missing. Modify
it to only treat _averunnable as obligatory, and handle missing
_fscale gracefully.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32884

Details

Provenance
mgorny_gentoo.orgAuthored on Nov 7 2021, 9:11 PM
jhbCommitted on Dec 7 2021, 11:36 PM
Differential Revision
D32884: libkvm: Fix kvm_getloadavg() on modern kernel vmcores
Parents
rGe9aeb50797fc: sys/_bitset.h: revert commit 74e014dbfab
Branches
Unknown
Tags
Unknown