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

Same Event ID used in multiple locations (OVERLOADED), should be unique #1588

Open
skliper opened this issue May 28, 2021 · 0 comments
Open

Comments

@skliper
Copy link
Contributor

skliper commented May 28, 2021

Is your feature request related to a problem? Please describe.
As part of EID scrub, identified the following cases where an EventId was used in multiple locations (intent is for EIDs to be unique).

CFE_ES_SYSLOG2_ERR_EID:

CFE_EVS_SendEvent(CFE_ES_SYSLOG2_ERR_EID, CFE_EVS_EventType_ERROR, "Error creating file %s, RC = 0x%08X",
Filename, (unsigned int)Status);

CFE_EVS_SendEvent(CFE_ES_SYSLOG2_ERR_EID, CFE_EVS_EventType_ERROR, "Error parsing file name RC = 0x%08X",
(unsigned int)Stat);

CFE_ES_ERLOG2_ERR_EID:

CFE_EVS_SendEvent(CFE_ES_ERLOG2_ERR_EID, CFE_EVS_EventType_ERROR, "Error creating file, RC = %d",
(int)Status);

CFE_EVS_SendEvent(CFE_ES_ERLOG2_ERR_EID, CFE_EVS_EventType_ERROR, "Error creating file %s, RC = %d",
BgFilePtr->FileWrite.FileName, (int)Status);

CFE_ES_PERF_LOG_ERR_EID:

CFE_EVS_SendEvent(CFE_ES_PERF_LOG_ERR_EID, CFE_EVS_EventType_ERROR, "Error parsing filename, RC = %d",
(int)Status);

CFE_EVS_SendEvent(CFE_ES_PERF_LOG_ERR_EID, CFE_EVS_EventType_ERROR,
"Error creating file %s, RC = %d", State->DataFileName, (int)Status);

CFE_ES_FILEWRITE_ERR_EID:

CFE_EVS_SendEvent(CFE_ES_FILEWRITE_ERR_EID, CFE_EVS_EventType_ERROR,
"File write,byte cnt err,file %s,request=%u,status=0x%08x", Filename, (unsigned int)Requested,
(unsigned int)Status);

CFE_EVS_SendEvent(CFE_ES_FILEWRITE_ERR_EID, CFE_EVS_EventType_ERROR,
"File write,byte cnt err,file %s,request=%u,actual=%u", BgFilePtr->FileWrite.FileName,
(int)BlockSize, (int)Status);

CFE_ES_CREATING_CDS_DUMP_ERR_EID:

CFE_EVS_SendEvent(CFE_ES_CREATING_CDS_DUMP_ERR_EID, CFE_EVS_EventType_ERROR,
"Error parsing CDS dump filename, Status=0x%08X", (unsigned int)Status);

CFE_EVS_SendEvent(CFE_ES_CREATING_CDS_DUMP_ERR_EID, CFE_EVS_EventType_ERROR,
"Error creating CDS dump file '%s', Status=0x%08X", DumpFilename, (unsigned int)Status);

#1117 documents overload CFE_SB_SND_RTG_EID and CFE_SB_SND_RTG_ERR1_EID

CFE_SB_BAD_CMD_CODE_EID:

CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR,
"Invalid Cmd, Unexpected Command Code %u", (unsigned int)FcnCode);
CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++;

CFE_EVS_SendEvent(CFE_SB_BAD_CMD_CODE_EID, CFE_EVS_EventType_ERROR,
"Invalid Cmd, Unexpected Command Code %u", FcnCode);
CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter++;

CFE_SB_GETPIPENAME_ID_ERR_EID:

PipeDscPtr = CFE_SB_LocatePipeDescByID(PipeId);
if (!CFE_SB_PipeDescIsMatch(PipeDscPtr, PipeId))
{
PendingEventID = CFE_SB_GETPIPENAME_ID_ERR_EID;

Status = OS_GetResourceName(SysQueueId, PipeNameBuf, PipeNameSize);
if (Status == OS_SUCCESS)
{
Status = CFE_SUCCESS;
}
else
{
PendingEventID = CFE_SB_GETPIPENAME_ID_ERR_EID;

CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID - Note the message also isn't all that useful.

Status = OS_QueueGetIdByName(&SysQueueId, PipeName);
if (Status == OS_SUCCESS)
{
Status = CFE_SUCCESS;
}
else
{
PendingEventID = CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID;

PendingEventID = CFE_SB_GETPIPEIDBYNAME_NAME_ERR_EID;
Status = CFE_SB_BAD_ARGUMENT;
break;
}
if (OS_ObjectIdEqual(PipeDscPtr->SysQueueId, SysQueueId))

CFE_EVS_ERR_CRLOGFILE_EID:

Result = CFE_FS_ParseInputFileNameEx(LogFilename, CmdPtr->LogFilename, sizeof(LogFilename),
sizeof(CmdPtr->LogFilename), CFE_PLATFORM_EVS_DEFAULT_LOG_FILE,
CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP),
CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP));
if (Result != OS_SUCCESS)
{
EVS_SendEvent(CFE_EVS_ERR_CRLOGFILE_EID, CFE_EVS_EventType_ERROR,
"Write Log File Command Error: CFE_FS_ParseInputFileNameEx() = 0x%08X", (unsigned int)Result);

/* Create the log file */
Result = OS_OpenCreate(&LogFileHandle, LogFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY);
if (Result != OS_SUCCESS)
{
EVS_SendEvent(CFE_EVS_ERR_CRLOGFILE_EID, CFE_EVS_EventType_ERROR,
"Write Log File Command Error: OS_OpenCreate = 0x%08X, filename = %s", (unsigned int)Result,
LogFilename);

CFE_EVS_ERR_EVTIDNOREGS_EID (might benefit from being common code):

EVS_SendEvent(CFE_EVS_ERR_EVTIDNOREGS_EID, CFE_EVS_EventType_ERROR,
"%s Event ID %d not registered for filtering: CC = %lu ", LocalName, (int)CmdPtr->EventID,
(long unsigned int)CFE_EVS_SET_FILTER_CC);

EVS_SendEvent(CFE_EVS_ERR_EVTIDNOREGS_EID, CFE_EVS_EventType_ERROR,
"%s Event ID %d not registered for filtering: CC = %lu", LocalName, (int)CmdPtr->EventID,
(long unsigned int)CFE_EVS_RESET_FILTER_CC);

EVS_SendEvent(CFE_EVS_ERR_EVTIDNOREGS_EID, CFE_EVS_EventType_ERROR,
"%s Event ID %d not registered for filtering: CC = %lu", LocalName, (int)CmdPtr->EventID,
(long unsigned int)CFE_EVS_DELETE_EVENT_FILTER_CC);

CFE_EVS_ERR_APPNOREGS_EID, CFE_EVS_ERR_ILLAPPIDRANGE_EID, CFE_EVS_ERR_NOAPPIDFOUND_EID - used in 10 locations, refactor!

CFE_EVS_ERR_CRDATFILE_EID:

Result = CFE_FS_ParseInputFileNameEx(LocalName, CmdPtr->AppDataFilename, sizeof(LocalName),
sizeof(CmdPtr->AppDataFilename), CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE,
CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP),
CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP));
if (Result != CFE_SUCCESS)
{
EVS_SendEvent(CFE_EVS_ERR_CRDATFILE_EID, CFE_EVS_EventType_ERROR,
"Write App Data Command Error: CFE_FS_ParseInputFileNameEx() = 0x%08X", (unsigned int)Result);

EVS_SendEvent(CFE_EVS_ERR_CRDATFILE_EID, CFE_EVS_EventType_ERROR,
"Write App Data Command Error: OS_OpenCreate = 0x%08X, filename = %s", (unsigned int)Result,
LocalName);

CFE_EVS_ERR_INVALID_BITMASK_EID used in 6 different places for different bitmasks, refactor candidate.

CFE_TBL_LOAD_SUCCESS_INF_EID:

CFE_EVS_SendEventWithAppID(CFE_TBL_LOAD_SUCCESS_INF_EID, CFE_EVS_EventType_DEBUG, CFE_TBL_Global.TableTaskAppId,
"Successfully loaded '%s' from '%s'", RegRecPtr->Name,
RegRecPtr->Buffers[0].DataSource);

CFE_EVS_SendEventWithAppID(CFE_TBL_LOAD_SUCCESS_INF_EID,
FirstTime ? CFE_EVS_EventType_DEBUG : CFE_EVS_EventType_INFORMATION,
CFE_TBL_Global.TableTaskAppId, "Successfully loaded '%s' from '%s'", RegRecPtr->Name,
RegRecPtr->LastFileLoaded);

CFE_TBL_VALIDATION_INF_EID:

CFE_EVS_SendEventWithAppID(CFE_TBL_VALIDATION_INF_EID, CFE_EVS_EventType_INFORMATION,
CFE_TBL_Global.TableTaskAppId, "%s validation successful for Inactive '%s'",
AppName, RegRecPtr->Name);

CFE_EVS_SendEventWithAppID(CFE_TBL_VALIDATION_INF_EID, CFE_EVS_EventType_INFORMATION,
CFE_TBL_Global.TableTaskAppId, "%s validation successful for Active '%s'",
AppName, RegRecPtr->Name);

CFE_TBL_FILE_ACCESS_ERR_EID:
Note - gave up here. Based on the number of these and no near-term solution it's likely explicitly recording every duplicate use of event IDs will be out of date by the time this is addressed. May note as "OVERLOADED" in event documentation but that isn't all that reliable either. Suggest scripted verification.

Describe the solution you'd like
Create unique EIDs

Describe alternatives you've considered
None

Additional context
#508

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 7.0.0 milestone May 28, 2021
@skliper skliper self-assigned this May 28, 2021
@skliper skliper removed this from the 7.0.0 milestone Jun 3, 2021
@skliper skliper removed their assignment Jun 16, 2021
@skliper skliper changed the title WIP - Event IDs used in multiple locations Same Event ID used in multiple locations (OVERLOADED) Jun 16, 2021
@skliper skliper changed the title Same Event ID used in multiple locations (OVERLOADED) Same Event ID used in multiple locations (OVERLOADED), should be unique Jun 16, 2021
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

1 participant