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

HS idle task only executes once and exits... reports CPU hogging all the time #21

Closed
2 tasks done
skliper opened this issue May 19, 2022 · 2 comments · Fixed by #25
Closed
2 tasks done

HS idle task only executes once and exits... reports CPU hogging all the time #21

skliper opened this issue May 19, 2022 · 2 comments · Fixed by #25

Comments

@skliper
Copy link
Contributor

skliper commented May 19, 2022

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
HS idle task used to have a while loop (from 2.3.2 tag):

HS/fsw/src/hs_custom.c

Lines 60 to 84 in 192a10f

while (HS_CustomData.IdleTaskRunStatus == CFE_SUCCESS)
{
/* Check to see if we are to mark the time. */
if(((HS_CustomData.ThisIdleTaskExec & HS_CustomData.UtilMask) == HS_CustomData.UtilMask) &&
(HS_CustomData.ThisIdleTaskExec > HS_CustomData.UtilMask))
{
/* Entry and Exit markers are for easy time marking only; not performance */
CFE_ES_PerfLogEntry(HS_IDLETASK_PERF_ID);
/* Increment the child task Execution Counter */
CFE_ES_IncrementTaskCounter();
/* update stamp and array */
CFE_PSP_GetTime(&PSPTime);
HS_CustomData.UtilArray[HS_CustomData.UtilArrayIndex & HS_CustomData.UtilArrayMask] = (uint32) PSPTime.microsecs;
HS_CustomData.UtilArrayIndex++;
CFE_ES_PerfLogExit(HS_IDLETASK_PERF_ID);
}
/* Call the Utilization Tracking function */
HS_UtilizationIncrement();
}

Now just runs once:

HS/fsw/src/hs_custom.c

Lines 51 to 80 in c5ef5ac

void HS_IdleTask(void)
{
OS_time_t PSPTime = {0};
HS_CustomData.IdleTaskRunStatus = CFE_SUCCESS;
/* Check to see if we are to mark the time. */
if (((HS_CustomData.ThisIdleTaskExec & HS_CustomData.UtilMask) == HS_CustomData.UtilMask) &&
(HS_CustomData.ThisIdleTaskExec > HS_CustomData.UtilMask))
{
/* Entry and Exit markers are for easy time marking only; not performance */
CFE_ES_PerfLogEntry(HS_IDLETASK_PERF_ID);
/* Increment the child task Execution Counter */
CFE_ES_IncrementTaskCounter();
/* update stamp and array */
CFE_PSP_GetTime(&PSPTime);
HS_CustomData.UtilArray[HS_CustomData.UtilArrayIndex & HS_CustomData.UtilArrayMask] = (uint32)PSPTime.ticks;
HS_CustomData.UtilArrayIndex++;
CFE_ES_PerfLogExit(HS_IDLETASK_PERF_ID);
}
/* Call the Utilization Tracking function */
HS_UtilizationIncrement();
return;
} /* End of HS_IdleTask() */

To Reproduce
Running cFS with HS reports hogging every time...

EVS Port1 66/1/HS 61: CPU Hogging Detected
1980-012-14:03:25.80827 HS App: CPU Hogging Detected

Expected behavior
Task should run in a loop and realistic margin should be getting reported

System observed on:

  • OS: Linux
  • Versions: 2.4.1+

Additional context
None

Reporter Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the bug label May 19, 2022
@skliper skliper added this to the Draco milestone May 19, 2022
@astrogeco
Copy link
Contributor

Do we just want to add the while loop back in?

skliper added a commit to skliper/HS that referenced this issue May 25, 2022
skliper added a commit to skliper/HS that referenced this issue May 25, 2022
skliper added a commit to skliper/HS that referenced this issue May 25, 2022
@astrogeco
Copy link
Contributor

CCB:2022-05-25 New PR introduced

astrogeco added a commit that referenced this issue May 31, 2022
Fix #21, Add idle task while loop back in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants