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

Fix #85, move system monitoring to PSP #90

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Removes all "Custom" routines from HS, and instead calls into PSP via the new iodriver mechanism. This is used to obtain average CPU utilization information rather than an idle task.

This architecture allows support for many more variables, such as per-cpu utilization information, temperature, fan speeds, and other health info. That is not implemented here, but could be added in the future.

Fix #85

Testing performed
Monitor HS telemetry, vary system load and confirm

Expected behavior changes
No more idle task, system load should be reported correctly on multi-core systems.

System(s) tested on
Debian

Additional context
Only Linux is implemented thus far, will need to create an RTEMS and VxWorks variant - but that is only in PSP - HS does not change

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

* Initialize The System Monitor functions
* --------------------------------------------------------
*/
int32 HS_SysMonInit(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
return StatusCode;
}

void HS_SysMonCleanup(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
* Obtain the System CPU utilization information
* --------------------------------------------------------
*/
int32 HS_SysMonGetCpuUtilization(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
* Initialize The System Monitor functions
* --------------------------------------------------------
*/
int32 HS_SysMonInit(void)

Check notice

Code scanning / CodeQL

Function too long

HS_SysMonInit has too many lines (65, while 60 are allowed).
Comment on lines +123 to +124
if (CFE_PSP_IODriver_Command(&Location, CFE_PSP_IODriver_SET_RUNNING, CFE_PSP_IODriver_U32ARG(0)) !=
CFE_PSP_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression

This Boolean expression is not side-effect free.
CFE_PSP_IODriver_Location_t Location;
int32 StatusCode;

if (CFE_PSP_IODriver_FindByName(HS_SYSTEM_MONITOR_DEVICE, &HS_AppData.SysMonPspModuleId) != CFE_PSP_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression

This Boolean expression is not side-effect free.
Comment on lines +66 to +67
if (CFE_PSP_IODriver_Command(&Location, CFE_PSP_IODriver_SET_RUNNING, CFE_PSP_IODriver_U32ARG(1)) !=
CFE_PSP_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression

This Boolean expression is not side-effect free.
Removes all "Custom" routines from HS, and instead calls into PSP via
the new iodriver mechanism.  This is used to obtain average CPU
utilization information rather than an idle task.

This architecuture allows support for many more variables, such as
per-cpu utilization information, temperature, fan speeds, and other health
info.  That is not implemented here, but could be added in the future.
@dzbaker dzbaker merged commit 3b7e5e7 into nasa:main Apr 13, 2023
@jphickey jphickey deleted the fix-85-idle-task branch April 17, 2023 16:42
@jphickey jphickey linked an issue Apr 20, 2023 that may be closed by this pull request
2 tasks
@jphickey jphickey linked an issue Apr 20, 2023 that may be closed by this pull request
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
@chillfig chillfig added the bug label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants