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

Factor out construction of FullName in SB event messages #1458

Open
skliper opened this issue Apr 29, 2021 · 0 comments · May be fixed by #2201
Open

Factor out construction of FullName in SB event messages #1458

skliper opened this issue Apr 29, 2021 · 0 comments · May be fixed by #2201

Comments

@skliper
Copy link
Contributor

skliper commented Apr 29, 2021

Is your feature request related to a problem? Please describe.
CFE_SB_GetAppTskName(TskId, FullName) is called in virtually every API event message, example:

case CFE_SB_CR_PIPE_BAD_ARG_EID:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_BAD_ARG_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"CreatePipeErr:Bad Input Arg:app=%s,ptr=0x%lx,depth=%d,maxdepth=%d",
CFE_SB_GetAppTskName(TskId, FullName), (unsigned long)PipeIdPtr, (int)Depth,
OS_QUEUE_MAX_DEPTH);
break;
case CFE_SB_MAX_PIPES_MET_EID:
CFE_EVS_SendEventWithAppID(CFE_SB_MAX_PIPES_MET_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"CreatePipeErr:Max Pipes(%d)In Use.app %s", CFE_PLATFORM_SB_MAX_PIPES,
CFE_SB_GetAppTskName(TskId, FullName));
break;
case CFE_SB_CR_PIPE_NAME_TAKEN_EID:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_NAME_TAKEN_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"CreatePipeErr:OS_QueueCreate failed, name taken (app=%s, name=%s)",
CFE_SB_GetAppTskName(TskId, FullName), PipeName);
break;
case CFE_SB_CR_PIPE_NO_FREE_EID:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_NO_FREE_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"CreatePipeErr:OS_QueueCreate failed, no free id's (app=%s)",
CFE_SB_GetAppTskName(TskId, FullName));
break;
case CFE_SB_CR_PIPE_ERR_EID:
CFE_EVS_SendEventWithAppID(CFE_SB_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
"CreatePipeErr:OS_QueueCreate returned %d,app %s", (int)Status,
CFE_SB_GetAppTskName(TskId, FullName));

Note for the special case in CFE_SB_DeletePipeFull it currently overloads FullName with caller and owner. Really should report both if there isn't a match. Also FullName is referenced before initialized below, but not used...:

Args.FullName = FullName;

Describe the solution you'd like
Construct FullName outside switch and use it.

Describe alternatives you've considered
Really there's inconsistent reporting in APIs (sometimes system log, sometimes events, unique message formats all over with differing info), would benefit from an overhaul. See also #1403 and related issues (#994, etc) to fix.

Additional context
Code review

Requester Info
Jacob Hageman - NASA/GSFC

thnkslprpt added a commit to thnkslprpt/cFE that referenced this issue Nov 9, 2022
thnkslprpt added a commit to thnkslprpt/cFE that referenced this issue Nov 9, 2022
thnkslprpt added a commit to thnkslprpt/cFE that referenced this issue Apr 19, 2024
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.

1 participant