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

HK missing CFE_ES_PerfLogEntry(HK_APPMAIN_PERF_ID) calls after CFE_SB_ReceiveBuffer in HK_AppMain #53

Open
2 tasks done
keegan-moore opened this issue Apr 25, 2023 · 0 comments

Comments

@keegan-moore
Copy link

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
Looks like HK is missing a couple of CFE_ES_PerfLogEntry(HK_APPMAIN_PERF_ID); calls after the CFE_SB_ReceiveBuffer in void HK_AppMain(void).

To Reproduce
Code inspection

Expected behavior
Every time the app wakes up, it should have an CFE_ES_PerfLogEntry call.
Every time the app wakes is about to block, it should have an CFE_ES_PerfLogExit call.

Code snips

    while (CFE_ES_RunLoop(&HK_AppData.RunStatus) == true)
    {
        /*
        ** Performance Log Exit Stamp.
        */
        CFE_ES_PerfLogExit(HK_APPMAIN_PERF_ID);

        /*
        ** Pend on the arrival of the next Software Bus message.
        */
        Status = CFE_SB_ReceiveBuffer(&BufPtr, HK_AppData.CmdPipe, HK_SB_TIMEOUT);

        if (Status == CFE_SUCCESS)
        {
            /*
            ** Performance Log Entry Stamp.
            */
            CFE_ES_PerfLogEntry(HK_APPMAIN_PERF_ID);

            /* Perform Message Processing */
            HK_AppPipe(BufPtr);
        }
        else if (Status == CFE_SB_TIME_OUT)
        {
            /* Check for copy table load and runtime dump request. This is
             * generally done during the housekeeping cycle.  If we are
             * getting routine messages at a rate of less than 1Hz we do
             * the routine maintenance here. */
            if (HK_CheckStatusOfTables() != HK_SUCCESS)
            {
                HK_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
            }
        }
        else
        {
            CFE_EVS_SendEvent(HK_RCV_MSG_ERR_EID, CFE_EVS_EventType_ERROR,
                              "HK_APP Exiting due to CFE_SB_RcvMsg error 0x%08X", (unsigned int)Status);

            /* Write to syslog in case there is a problem with event services */
            CFE_ES_WriteToSysLog("HK_APP Exiting due to CFE_SB_RcvMsg error 0x%08X\n", (unsigned int)Status);

            HK_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
        }
    } /* end while */

System observed on:

  • Hardware: any
  • OS: any
  • Versions: I'm looking at the draco rc4 release, but it looks like this is HK v2.5.1

Additional context
Add any other context about the problem here.

Reporter Info
Keegan Moore
NASA/GSFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants