Page MenuHomeFreeBSD

libkvm: Fix kvm_getloadavg() on modern kernel vmcores
ClosedPublic

Authored by mgorny_gentoo.org on Nov 7 2021, 9:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 18 2024, 8:03 PM
Unknown Object (File)
Oct 7 2024, 9:07 AM
Unknown Object (File)
Oct 4 2024, 7:05 AM
Unknown Object (File)
Oct 1 2024, 1:52 PM
Unknown Object (File)
Sep 23 2024, 1:26 PM
Unknown Object (File)
Sep 19 2024, 5:40 AM
Unknown Object (File)
Sep 18 2024, 9:45 AM
Unknown Object (File)
Sep 5 2024, 5:53 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mgorny_gentoo.org created this revision.
This revision is now accepted and ready to land.Nov 9 2021, 5:45 PM

Could you push this for me, as I don't have push access?

Do you happen to have an existing git commit for this pushed somewhere public?