Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libkvm: Fix kvm_getloadavg() on modern kernel vmcores #570

Closed
wants to merge 1 commit into from

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Dec 7, 2021

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

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
@bsdjhb
Copy link
Member

bsdjhb commented Dec 7, 2021

Merged as 8099a35.

@bsdjhb bsdjhb closed this Dec 7, 2021
@stevenhull
Copy link

stevenhull commented Dec 10, 2021 via email

freebsd-git pushed a commit that referenced this pull request Feb 23, 2022
Reviewed by: imp
Pull Request: #570
bsdimp pushed a commit to bsdimp/dtc that referenced this pull request Feb 24, 2022
Reviewed by: imp
Pull Request: freebsd/freebsd-src#570
FreeBSD Hash: 62d16ad37df7d9efb6e329c9e7ca1fc3975a1966
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Mar 4, 2022
freebsd-git pushed a commit that referenced this pull request Mar 9, 2022
Reviewed by: imp
Pull Request: #570

(cherry picked from commit 62d16ad)
zxombie pushed a commit to CTSRD-CHERI/freebsd-morello that referenced this pull request Mar 11, 2022
freebsd-git pushed a commit that referenced this pull request Apr 1, 2022
Reviewed by: imp
Pull Request: #570

(cherry picked from commit 62d16ad)
@emaste emaste added the merged label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants