Skip to content

Commit

Permalink
Fix nasa#1325, Prepend CFE_ES_WriteToSysLog with function name
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Jun 7, 2021
1 parent 306593b commit 5d7d047
Show file tree
Hide file tree
Showing 29 changed files with 240 additions and 240 deletions.
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int32 CFE_Assert_LibInit(CFE_ES_LibId_t LibId)
status = OS_MutSemCreate(&CFE_Assert_Global.AccessMutex, "CFE_Assert", 0);
if (status != OS_SUCCESS)
{
CFE_ES_WriteToSysLog("%s(): OS_MutSemCreate failed, rc=%d\n", __func__, (int)status);
CFE_ES_WriteToSysLog("%s: OS_MutSemCreate failed, rc=%d\n", __func__, (int)status);
return CFE_STATUS_EXTERNAL_RESOURCE_FAIL;
}

Expand Down
12 changes: 6 additions & 6 deletions modules/cfe_assert/src/cfe_assert_runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int32 CFE_Assert_RegisterTest(const char *TestName)
CFE_EVS_EventFilter_BINARY);
if (rc != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Error from CFE_EVS_Register: %08lx\n", (unsigned long)rc);
CFE_ES_WriteToSysLog("%s: Error from CFE_EVS_Register: %08lx\n", __func__, (unsigned long)rc);
return rc;
}

Expand All @@ -123,7 +123,7 @@ int32 CFE_Assert_RegisterTest(const char *TestName)
rc = CFE_ES_WaitForSystemState(CFE_ES_SystemState_OPERATIONAL, CFE_TESTRUNNER_MAX_STARTUP_WAIT);
if (rc != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Error while waiting for OPERATIONAL state: %08lx\n", (unsigned long)rc);
CFE_ES_WriteToSysLog("%s: Error while waiting for OPERATIONAL state: %08lx\n", __func__, (unsigned long)rc);
return rc;
}

Expand All @@ -134,7 +134,7 @@ int32 CFE_Assert_RegisterTest(const char *TestName)
rc = OS_MutSemTake(CFE_Assert_Global.AccessMutex);
if (rc != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("%s(): Error from OS_MutSemTake(): %d\n", __func__, (int)rc);
CFE_ES_WriteToSysLog("%s: Error from OS_MutSemTake(): %d\n", __func__, (int)rc);
return CFE_STATUS_EXTERNAL_RESOURCE_FAIL;
}

Expand All @@ -144,7 +144,7 @@ int32 CFE_Assert_RegisterTest(const char *TestName)
rc = CFE_ES_GetAppID(&CFE_Assert_Global.OwnerAppId);
if (rc != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("%s(): Error from CFE_ES_GetAppId(): %08x\n", __func__, (unsigned int)rc);
CFE_ES_WriteToSysLog("%s: Error from CFE_ES_GetAppId(): %08x\n", __func__, (unsigned int)rc);
OS_MutSemGive(CFE_Assert_Global.AccessMutex);
return rc;
}
Expand Down Expand Up @@ -197,7 +197,7 @@ void CFE_Assert_ExecuteTest(void)
rc = CFE_ES_GetAppID(&AppId);
if (rc != CFE_SUCCESS || !CFE_RESOURCEID_TEST_EQUAL(AppId, CFE_Assert_Global.OwnerAppId))
{
CFE_ES_WriteToSysLog("%s(): Invalid calling context, CFE_ES_GetAppId() rc=%08x AppId=%lx, OwnerAppId=%lx\n",
CFE_ES_WriteToSysLog("%s: Invalid calling context, CFE_ES_GetAppId() rc=%08x AppId=%lx, OwnerAppId=%lx\n",
__func__, (unsigned int)rc, CFE_RESOURCEID_TO_ULONG(AppId),
CFE_RESOURCEID_TO_ULONG(CFE_Assert_Global.OwnerAppId));
return;
Expand All @@ -217,6 +217,6 @@ void CFE_Assert_ExecuteTest(void)
rc = OS_MutSemGive(CFE_Assert_Global.AccessMutex);
if (rc != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("%s(): Error from OS_MutSemGive(): %d\n", __func__, (int)rc);
CFE_ES_WriteToSysLog("%s: Error from OS_MutSemGive(): %d\n", __func__, (int)rc);
}
}
46 changes: 23 additions & 23 deletions modules/es/fsw/src/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CFE_Status_t CFE_ES_ResetCFE(uint32 ResetType)
if (CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount >
CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount)
{
CFE_ES_WriteToSysLog("POWER ON RESET due to max proc resets (Commanded).\n");
CFE_ES_WriteToSysLog("%s: POWER ON RESET due to max proc resets (Commanded).\n", __func__);

/*
** Log the reset in the ER Log. The log will be wiped out, but it's good to have
Expand All @@ -101,7 +101,7 @@ CFE_Status_t CFE_ES_ResetCFE(uint32 ResetType)
}
else
{
CFE_ES_WriteToSysLog("PROCESSOR RESET called from CFE_ES_ResetCFE (Commanded).\n");
CFE_ES_WriteToSysLog("%s: PROCESSOR RESET called from CFE_ES_ResetCFE (Commanded).\n", __func__);

/*
** Update the reset variables
Expand All @@ -128,7 +128,7 @@ CFE_Status_t CFE_ES_ResetCFE(uint32 ResetType)
}
else if (ResetType == CFE_PSP_RST_TYPE_POWERON)
{
CFE_ES_WriteToSysLog("POWERON RESET called from CFE_ES_ResetCFE (Commanded).\n");
CFE_ES_WriteToSysLog("%s: POWERON RESET called from CFE_ES_ResetCFE (Commanded).\n", __func__);

/*
** Log the reset in the ER Log. The log will be wiped out, but it's good to have
Expand All @@ -150,7 +150,7 @@ CFE_Status_t CFE_ES_ResetCFE(uint32 ResetType)
}
else
{
CFE_ES_WriteToSysLog("ES ResetCFE: Invalid Reset Type: %d.\n", (int)ResetType);
CFE_ES_WriteToSysLog("%s: Invalid Reset Type: %d.\n", __func__, (int)ResetType);
ReturnCode = CFE_ES_BAD_ARGUMENT;
}

Expand Down Expand Up @@ -218,7 +218,7 @@ CFE_Status_t CFE_ES_RestartApp(CFE_ES_AppId_t AppID)
{
ReturnCode = CFE_ES_ERR_RESOURCEID_NOT_VALID;

CFE_ES_WriteToSysLog("CFE_ES_RestartApp: Invalid Application ID received, AppID = %lu\n",
CFE_ES_WriteToSysLog("%s: Invalid Application ID received, AppID = %lu\n", __func__,
CFE_RESOURCEID_TO_ULONG(AppID));

} /* end if */
Expand Down Expand Up @@ -410,7 +410,7 @@ void CFE_ES_ExitApp(uint32 ExitStatus)
** but it may return during unit testing. If it does,
** log the return code (even if it claims CFE_SUCCESS).
*/
CFE_ES_WriteToSysLog("CFE_ES_ExitApp: CORE Application Init Error Processor Reset, RC = 0x%08X\n",
CFE_ES_WriteToSysLog("%s: CORE Application Init Error Processor Reset, RC = 0x%08X\n", __func__,
(unsigned int)ReturnCode);

return;
Expand Down Expand Up @@ -1013,7 +1013,7 @@ CFE_Status_t CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId)

if (AppInfo == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: Invalid Parameter ( Null Pointer )\n");
CFE_ES_WriteToSysLog("%s: Invalid Parameter ( Null Pointer )\n", __func__);
return CFE_ES_BAD_ARGUMENT;
}

Expand All @@ -1029,7 +1029,7 @@ CFE_Status_t CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId)
/*
* Log a message if called with an invalid ID.
*/
CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: App ID not active: %lu\n", CFE_RESOURCEID_TO_ULONG(AppId));
CFE_ES_WriteToSysLog("%s: App ID not active: %lu\n", __func__, CFE_RESOURCEID_TO_ULONG(AppId));

Status = CFE_ES_ERR_RESOURCEID_NOT_VALID;
}
Expand Down Expand Up @@ -1108,7 +1108,7 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId)

if (LibInfo == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_GetLibInfo: Invalid Parameter ( Null Pointer )\n");
CFE_ES_WriteToSysLog("%s: Invalid Parameter ( Null Pointer )\n", __func__);
return CFE_ES_BAD_ARGUMENT;
}

Expand Down Expand Up @@ -1180,7 +1180,7 @@ int32 CFE_ES_GetModuleInfo(CFE_ES_AppInfo_t *ModuleInfo, CFE_ResourceId_t Resour
/*
* Log a message if called with an invalid ID.
*/
CFE_ES_WriteToSysLog("CFE_ES_GetModuleInfo: Resource ID not valid: %lu\n",
CFE_ES_WriteToSysLog("%s: Resource ID not valid: %lu\n", __func__,
CFE_ResourceId_ToInteger(ResourceId));
Status = CFE_ES_ERR_RESOURCEID_NOT_VALID;
break;
Expand All @@ -1205,7 +1205,7 @@ CFE_Status_t CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t Tas

if (TaskInfo == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_GetTaskInfo: Invalid Parameter ( Null Pointer )\n");
CFE_ES_WriteToSysLog("%s: Invalid Parameter ( Null Pointer )\n", __func__);
return CFE_ES_BAD_ARGUMENT;
}

Expand Down Expand Up @@ -1296,24 +1296,24 @@ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *Task
{
if (TaskName == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_CreateChildTask: Task Id and Name Pointer Parameters are NULL.\n");
CFE_ES_WriteToSysLog("%s: Task Id and Name Pointer Parameters are NULL.\n", __func__);
ReturnCode = CFE_ES_BAD_ARGUMENT;
}
else
{
CFE_ES_WriteToSysLog("CFE_ES_CreateChildTask: Task Id Pointer Parameter is NULL for Task '%s'.\n",
CFE_ES_WriteToSysLog("%s: Task Id Pointer Parameter is NULL for Task '%s'.\n", __func__,
TaskName);
ReturnCode = CFE_ES_BAD_ARGUMENT;
}
}
else if (TaskName == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_CreateChildTask: TaskName Parameter is NULL\n");
CFE_ES_WriteToSysLog("%s: TaskName Parameter is NULL\n", __func__);
ReturnCode = CFE_ES_BAD_ARGUMENT;
}
else if (FunctionPtr == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_CreateChildTask: Function Pointer Parameter is NULL for Task '%s'\n", TaskName);
CFE_ES_WriteToSysLog("%s: Function Pointer Parameter is NULL for Task '%s'\n", __func__, TaskName);
ReturnCode = CFE_ES_BAD_ARGUMENT;
}
else
Expand Down Expand Up @@ -1506,7 +1506,7 @@ CFE_Status_t CFE_ES_DeleteChildTask(CFE_ES_TaskId_t TaskId)
/*
** Task ID is invalid ( too large )
*/
CFE_ES_WriteToSysLog("CFE_ES_DeleteChildTask Error: Invalid Task ID: %lu\n", CFE_RESOURCEID_TO_ULONG(TaskId));
CFE_ES_WriteToSysLog("%s: Error: Invalid Task ID: %lu\n", __func__, CFE_RESOURCEID_TO_ULONG(TaskId));
ReturnCode = CFE_ES_ERR_RESOURCEID_NOT_VALID;
}
return (ReturnCode);
Expand Down Expand Up @@ -1655,7 +1655,7 @@ uint32 CFE_ES_CalculateCRC(const void *DataPtr, size_t DataLength, uint32 InputC
switch (TypeCRC)
{
case CFE_MISSION_ES_CRC_32:
CFE_ES_WriteToSysLog("CFE ES Calculate CRC32 not Implemented\n");
CFE_ES_WriteToSysLog("%s: Calculate CRC32 not Implemented\n", __func__);
break;

case CFE_MISSION_ES_CRC_16:
Expand All @@ -1676,7 +1676,7 @@ uint32 CFE_ES_CalculateCRC(const void *DataPtr, size_t DataLength, uint32 InputC
break;

case CFE_MISSION_ES_CRC_8:
CFE_ES_WriteToSysLog("CFE ES Calculate CRC8 not Implemented\n");
CFE_ES_WriteToSysLog("%s: Calculate CRC8 not Implemented\n", __func__);
break;

default:
Expand Down Expand Up @@ -1707,7 +1707,7 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, size_t BlockSi

if (CDSHandlePtr == NULL || Name == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_RegisterCDS:-Failed invalid arguments\n");
CFE_ES_WriteToSysLog("%s: Failed invalid arguments\n", __func__);
return CFE_ES_BAD_ARGUMENT;
}

Expand All @@ -1716,11 +1716,11 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, size_t BlockSi

if (Status != CFE_SUCCESS) /* Application ID was invalid */
{
CFE_ES_WriteToSysLog("CFE_CDS:Register-Bad AppId context\n");
CFE_ES_WriteToSysLog("%s: Bad AppId context\n", __func__);
}
else if (!CFE_ES_Global.CDSIsAvailable)
{
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS not available\n");
CFE_ES_WriteToSysLog("%s: CDS not available\n", __func__);
Status = CFE_ES_NOT_IMPLEMENTED;
}
else
Expand All @@ -1735,7 +1735,7 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, size_t BlockSi

strncpy(CDSName, Name, sizeof(CDSName) - 1);
CDSName[sizeof(CDSName) - 1] = '\0';
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS Name (%s) is too long\n", CDSName);
CFE_ES_WriteToSysLog("%s: CDS Name (%s) is too long\n", __func__, CDSName);
}
else
{
Expand All @@ -1749,7 +1749,7 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, size_t BlockSi
/* If size is unacceptable, log it */
if (Status == CFE_ES_CDS_INVALID_SIZE)
{
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS %s has invalid size (%lu)\n", Name,
CFE_ES_WriteToSysLog("%s: CDS %s has invalid size (%lu)\n", __func__, Name,
(unsigned long)BlockSize);
}
}
Expand Down
Loading

0 comments on commit 5d7d047

Please sign in to comment.