Repository navigation
Fix #506, update linux sysmon to use /proc/stat - #509
Merged
Merged
Conversation
jphickey
force-pushed
the
fix-506-procstat
branch
from
September 25, 2026 16:08
a886a74 to
0e86818
Compare
36 tasks
Contributor
Author
|
NOTE: the other warnings in the |
Use data from /proc/stat instead of /proc/schedstat. The latter was more intended for debugging the kernel and is not widely available, as it depends on kernel options to enable it. The /proc/stat data should be universally available on Linux, but the format and units are somewhat different. This also enables us to segregate the CPU usage into user and kernel mode. The data comes for free with the idle info, so this makes it available as well.
jphickey
force-pushed
the
fix-506-procstat
branch
from
September 29, 2026 19:11
0e86818 to
bfbd8f0
Compare
Contributor
Author
|
Rebased since the other static analysis warning was fixed. This should get a clean run. |
chillfig
self-requested a review
October 5, 2026 13:59
chillfig
previously approved these changes
Oct 6, 2026
chillfig
left a comment
Member
There was a problem hiding this comment.
Found a potential overbounds read if we have a large number of CPUs. Risk is low assuming number of CPUs are nominal.
22 tasks
chillfig
previously approved these changes
Oct 8, 2026
chillfig
left a comment
Member
There was a problem hiding this comment.
Could maybe use a clang-format (https://github.com/nasa/PSP/actions/runs/37805865884/job/113409851932?pr=509) but otherwise looks good to me!
Update the loop limit to take LINUX_SYSMON_MAX_CPUS into account as well
jphickey
force-pushed
the
fix-506-procstat
branch
from
October 8, 2026 19:15
e231401 to
f579373
Compare
chillfig
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
name: FSW Code Change
about: Flight Software code changes
labels: fsw
Description of Change
Use data from /proc/stat instead of /proc/schedstat. The latter was more intended for debugging the kernel and is not widely available, as it depends on kernel options to enable it.
The /proc/stat data should be universally available on Linux, but the format and units are somewhat different. This also enables us to segregate the CPU usage into user and kernel mode. The data comes for free with the idle info, so this makes it available as well.
Linked Issue
Closes #506
Requirements Impact
Testing Evidence
Execute CFS w/HS on Linux host. Verify that CPU load info is being correctly published by HS.
Note that without /proc/schedstat, the previous impl would fail to initialize.
Areas of Expertise Touched
Author Checklist
.clang-formatReviewer Checklist
.clang-formathas been appliedReviewer Testing Notes