Skip to content

Commit

Permalink
Fix nasa#2502, correct name mismatches in ES, FS, and TIME
Browse files Browse the repository at this point in the history
Corrects cases where CFE symbol names did not exactly match expected
conventions.
  • Loading branch information
jphickey committed Jan 29, 2024
1 parent 37f1d28 commit aa4afad
Show file tree
Hide file tree
Showing 24 changed files with 177 additions and 175 deletions.
4 changes: 2 additions & 2 deletions docs/src/cfe_es.dox
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,13 @@
The System Log is an array of bytes that contains back-to-back printf type
messages from applications. The cFE internal applications use this log when
errors are encountered during initialization before the Event Manager is fully
initialized. To view the information the #CFE_ES_WRITE_SYSLOG_CC command must
initialized. To view the information the #CFE_ES_WRITE_SYS_LOG_CC command must
be sent. This command will write the log to a binary file. The path and
filename may be specified in the command. If the filename command field
contains an empty string, the configuration parameter
#CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE is used to specify the path and filename. Use the
ground system to get the file and display the contents. The
#CFE_ES_CLEAR_SYSLOG_CC is used to clear the System log.
#CFE_ES_CLEAR_SYS_LOG_CC is used to clear the System log.

The size of the System log is defined by the platform configuration parameter
#CFE_PLATFORM_ES_SYSTEM_LOG_SIZE. This log is preserved after a processor reset and
Expand Down
4 changes: 2 additions & 2 deletions docs/src/cfe_time.dox
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
TIME provides the ability to command a one time adjustment
(#CFE_TIME_ADD_ADJUST_CC and #CFE_TIME_SUB_ADJUST_CC)
to the current STCF. In addition there is a 1Hz adjustment
(#CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC and #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC)
(#CFE_TIME_ADD_ONE_HZ_ADJUSTMENT_CC and #CFE_TIME_SUB_ONE_HZ_ADJUSTMENT_CC)
that can be made to the STCF to compensate for oscillator drift.
Mission specific ground correlation should be used to assist in
determining the proper values to use. The Leap Seconds should be
Expand All @@ -671,7 +671,7 @@
to by the other systems.

\sa #CFE_TIME_ADD_ADJUST_CC, #CFE_TIME_SUB_ADJUST_CC, #CFE_TIME_SET_STCF_CC,
#CFE_TIME_ADD_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SUB_ONEHZ_ADJUSTMENT_CC, #CFE_TIME_SET_LEAP_SECONDS_CC
#CFE_TIME_ADD_ONE_HZ_ADJUSTMENT_CC, #CFE_TIME_SUB_ONE_HZ_ADJUSTMENT_CC, #CFE_TIME_SET_LEAP_SECONDS_CC
**/


Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/eds/cfe_fs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<Enumeration label="ES_SYSLOG" value="2" shortDescription="Executive Services System Log Type">
<LongDescription>
Executive Services System Log File which is generated in response to a
\link #CFE_ES_WRITE_SYSLOG_CC \ES_WRITESYSLOG2FILE \endlink
\link #CFE_ES_WRITE_SYS_LOG_CC \ES_WRITESYSLOG2FILE \endlink
command.
</LongDescription>
</Enumeration>
Expand Down
20 changes: 10 additions & 10 deletions modules/es/config/default_cfe_es_fcncodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,10 @@
** This command is not dangerous. However, any previously logged data
** will be lost.
**
** \sa #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_CLEAR_ER_LOG_CC, #CFE_ES_WRITE_ER_LOG_CC,
** #CFE_ES_OVER_WRITE_SYSLOG_CC
** \sa #CFE_ES_WRITE_SYS_LOG_CC, #CFE_ES_CLEAR_ER_LOG_CC, #CFE_ES_WRITE_ER_LOG_CC,
** #CFE_ES_OVER_WRITE_SYS_LOG_CC
*/
#define CFE_ES_CLEAR_SYSLOG_CC 10
#define CFE_ES_CLEAR_SYS_LOG_CC 10

/** \cfeescmd Writes contents of Executive Services System Log to a File
**
Expand Down Expand Up @@ -500,10 +500,10 @@
** if performed repeatedly without sufficient file management by the
** operator, fill the file system.
**
** \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_CLEAR_ER_LOG_CC, #CFE_ES_WRITE_ER_LOG_CC,
** #CFE_ES_OVER_WRITE_SYSLOG_CC
** \sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_CLEAR_ER_LOG_CC, #CFE_ES_WRITE_ER_LOG_CC,
** #CFE_ES_OVER_WRITE_SYS_LOG_CC
*/
#define CFE_ES_WRITE_SYSLOG_CC 11
#define CFE_ES_WRITE_SYS_LOG_CC 11

/** \cfeescmd Clears the contents of the Exception and Reset Log
**
Expand Down Expand Up @@ -535,7 +535,7 @@
** This command is not dangerous. However, any previously logged data
** will be lost.
**
** \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_WRITE_ER_LOG_CC
** \sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_WRITE_SYS_LOG_CC, #CFE_ES_WRITE_ER_LOG_CC
*/
#define CFE_ES_CLEAR_ER_LOG_CC 12

Expand Down Expand Up @@ -578,7 +578,7 @@
** if performed repeatedly without sufficient file management by the
** operator, fill the file system.
**
** \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_CLEAR_ER_LOG_CC
** \sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_WRITE_SYS_LOG_CC, #CFE_ES_CLEAR_ER_LOG_CC
*/
#define CFE_ES_WRITE_ER_LOG_CC 13

Expand Down Expand Up @@ -787,9 +787,9 @@
** identifying the cause of a problem to be lost by a subsequent flood of
** additional messages).
**
** \sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC
** \sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_WRITE_SYS_LOG_CC
*/
#define CFE_ES_OVER_WRITE_SYSLOG_CC 18
#define CFE_ES_OVER_WRITE_SYS_LOG_CC 18

/** \cfeescmd Resets the Processor Reset Counter to Zero
**
Expand Down
1 change: 1 addition & 0 deletions modules/es/config/default_cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define CFE_ES_MSG_H

#include "cfe_mission_cfg.h"
#include "cfe_es_fcncodes.h"
#include "cfe_es_msgdefs.h"
#include "cfe_es_msgstruct.h"

Expand Down
16 changes: 8 additions & 8 deletions modules/es/config/default_cfe_es_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct CFE_ES_RestartCmd_Payload
**
** This format is shared by several executive services commands.
** For command details, see #CFE_ES_QUERY_ALL_CC, #CFE_ES_QUERY_ALL_TASKS_CC,
** #CFE_ES_WRITE_SYSLOG_CC, and #CFE_ES_WRITE_ER_LOG_CC
** #CFE_ES_WRITE_SYS_LOG_CC, and #CFE_ES_WRITE_ER_LOG_CC
**
**/
typedef struct CFE_ES_FileNameCmd_Payload
Expand All @@ -64,7 +64,7 @@ typedef struct CFE_ES_FileNameCmd_Payload
/**
** \brief Overwrite/Discard System Log Configuration Command Payload
**
** For command details, see #CFE_ES_OVER_WRITE_SYSLOG_CC
** For command details, see #CFE_ES_OVER_WRITE_SYS_LOG_CC
**
**/
typedef struct CFE_ES_OverWriteSysLogCmd_Payload
Expand Down Expand Up @@ -146,13 +146,12 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload
/**
* @brief Labels for values to use in #CFE_ES_StartPerfCmd_Payload.TriggerMode
* @sa CFE_ES_StartPerfCmd_Payload
*/
*/
enum CFE_ES_PerfMode
{
CFE_ES_PERF_TRIGGER_START = 0,
CFE_ES_PERF_TRIGGER_CENTER,
CFE_ES_PERF_TRIGGER_END,
CFE_ES_PERF_MAX_MODES
CFE_ES_PerfTrigger_START = 0,
CFE_ES_PerfTrigger_CENTER,
CFE_ES_PerfTrigger_END
};

typedef uint32 CFE_ES_PerfMode_Enum_t;
Expand All @@ -165,7 +164,8 @@ typedef uint32 CFE_ES_PerfMode_Enum_t;
**/
typedef struct CFE_ES_StartPerfCmd_Payload
{
CFE_ES_PerfMode_Enum_t TriggerMode; /**< \brief Desired trigger position (Start, Center, End). Values defined by #CFE_ES_PerfMode. */
CFE_ES_PerfMode_Enum_t
TriggerMode; /**< \brief Desired trigger position (Start, Center, End). Values defined by #CFE_ES_PerfMode. */
} CFE_ES_StartPerfCmd_Payload_t;

/**
Expand Down
43 changes: 22 additions & 21 deletions modules/es/eds/cfe_es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@
</EnumerationList>
</EnumeratedDataType>

<EnumeratedDataType name="PerfTrigger" shortDescription="Performance Monitor trigger modes">
<IntegerDataEncoding sizeInBits="32" encoding="unsigned" />
<EnumerationList>
<Enumeration label="START" value="0" shortDescription="Trigger at start" />
<Enumeration label="CENTER" value="1" shortDescription="Trigger at center" />
<Enumeration label="END" value="2" shortDescription="Trigger at end" />
</EnumerationList>
</EnumeratedDataType>

<ContainerDataType name="AppId" baseType="CFE_RESOURCEID/BaseType" shortDescription="A type for Application IDs">
<LongDescription>
This is the type that is used for any API accepting or returning an App ID
Expand Down Expand Up @@ -165,7 +174,7 @@
</Range>
</IntegerDataType>

<IntegerDataType name="MemOffset" shortDescription="Integer type used for CPU memory addresses, sizes and offsets">
<AliasDataType name="MemOffset" type="BASE_TYPES/MemReference" shortDescription="Integer type used for CPU memory addresses, sizes and offsets">
<LongDescription>
For backward compatibility with existing CFS code this should be uint32,
but all telemetry information will be limited to 4GB in size as a result.
Expand All @@ -177,13 +186,9 @@
In either case this must be an unsigned type, and should be large enough
to represent the largest memory address/size in use in the CFS system.
</LongDescription>
<IntegerDataEncoding sizeInBits="${CFE_MISSION/MEM_REFERENCE_SIZE_BITS}" encoding="unsigned" />
<Range>
<MinMaxRange max="2 ^ ${CFE_MISSION/MEM_REFERENCE_SIZE_BITS}" min="0" rangeType="inclusiveMinExclusiveMax"/>
</Range>
</IntegerDataType>
</AliasDataType>

<IntegerDataType name="MemAddress" shortDescription="Integer type used for CPU memory addresses, sizes and offsets">
<AliasDataType name="MemAddress" type="BASE_TYPES/MemReference" shortDescription="Integer type used for CPU memory addresses, sizes and offsets">
<LongDescription>
For backward compatibility with existing CFS code this should be uint32,
but all telemetry information will be limited to 4GB in size as a result.
Expand All @@ -195,11 +200,7 @@
In either case this must be an unsigned type, and should be large enough
to represent the largest memory address/size in use in the CFS system.
</LongDescription>
<IntegerDataEncoding sizeInBits="${CFE_MISSION/MEM_REFERENCE_SIZE_BITS}" encoding="unsigned" />
<Range>
<MinMaxRange max="2 ^ ${CFE_MISSION/MEM_REFERENCE_SIZE_BITS}" min="0" rangeType="inclusiveMinExclusiveMax"/>
</Range>
</IntegerDataType>
</AliasDataType>

<StringDataType name="char_x_CFE_ES_CDS_MAX_FULL_NAME_LEN" length="${CFE_MISSION/ES_CDS_MAX_FULL_NAME_LEN}" />

Expand Down Expand Up @@ -402,7 +403,7 @@

<ContainerDataType name="OverWriteSysLogCmd_Payload" shortDescription="Overwrite/Discard System Log Configuration Command">
<LongDescription>
For command details, see #CFE_ES_OVERWRITE_SYSLOG_CC
For command details, see #CFE_ES_OVERWRITE_SYS_LOG_CC
</LongDescription>
<EntryList>
<Entry name="Mode" type="LogMode">
Expand Down Expand Up @@ -475,7 +476,7 @@
For command details, see #CFE_ES_PERF_STARTDATA_CC
</LongDescription>
<EntryList>
<Entry name="TriggerMode" type="BASE_TYPES/uint32" shortDescription="Desired trigger position (Start, Center, End)" />
<Entry name="TriggerMode" type="PerfTrigger" shortDescription="Desired trigger position (Start, Center, End)" />
</EntryList>
</ContainerDataType>

Expand Down Expand Up @@ -1300,8 +1301,8 @@
This command is not dangerous. However, any previously logged data
will be lost.

\sa #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_CLEAR_ERLOG_CC, #CFE_ES_WRITE_ERLOG_CC,
#CFE_ES_OVERWRITE_SYSLOG_CC
\sa #CFE_ES_WRITE_SYS_LOG_CC, #CFE_ES_CLEAR_ERLOG_CC, #CFE_ES_WRITE_ERLOG_CC,
#CFE_ES_OVERWRITE_SYS_LOG_CC
</LongDescription>
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="10" />
Expand Down Expand Up @@ -1351,8 +1352,8 @@
if performed repeatedly without sufficient file management by the
operator, fill the file system.

\sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_CLEAR_ERLOG_CC, #CFE_ES_WRITE_ERLOG_CC,
#CFE_ES_OVERWRITE_SYSLOG_CC
\sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_CLEAR_ERLOG_CC, #CFE_ES_WRITE_ERLOG_CC,
#CFE_ES_OVERWRITE_SYS_LOG_CC
</LongDescription>
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="11" />
Expand Down Expand Up @@ -1400,7 +1401,7 @@
This command is not dangerous. However, any previously logged data
will be lost.

\sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_WRITE_ERLOG_CC
\sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_WRITE_SYS_LOG_CC, #CFE_ES_WRITE_ERLOG_CC
</LongDescription>
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="12" />
Expand Down Expand Up @@ -1450,7 +1451,7 @@
if performed repeatedly without sufficient file management by the
operator, fill the file system.

\sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC, #CFE_ES_CLEAR_ERLOG_CC
\sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_WRITE_SYS_LOG_CC, #CFE_ES_CLEAR_ERLOG_CC
</LongDescription>
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="13" />
Expand Down Expand Up @@ -1710,7 +1711,7 @@
identifying the cause of a problem to be lost by a subsequent flood of
additional messages).

\sa #CFE_ES_CLEAR_SYSLOG_CC, #CFE_ES_WRITE_SYSLOG_CC
\sa #CFE_ES_CLEAR_SYS_LOG_CC, #CFE_ES_WRITE_SYS_LOG_CC
</LongDescription>
<ConstraintSet>
<ValueConstraint entry="Sec.FunctionCode" value="18" />
Expand Down
10 changes: 5 additions & 5 deletions modules/es/fsw/inc/cfe_es_eventids.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
*
* \par Cause:
*
* \link #CFE_ES_CLEAR_SYSLOG_CC ES Clear System Log Command \endlink success.
* \link #CFE_ES_CLEAR_SYS_LOG_CC ES Clear System Log Command \endlink success.
*/
#define CFE_ES_SYSLOG1_INF_EID 17

Expand All @@ -223,7 +223,7 @@
*
* \par Cause:
*
* \link #CFE_ES_CLEAR_SYSLOG_CC ES Write System Log Command \endlink success.
* \link #CFE_ES_CLEAR_SYS_LOG_CC ES Write System Log Command \endlink success.
*/
#define CFE_ES_SYSLOG2_EID 18

Expand Down Expand Up @@ -608,7 +608,7 @@
*
* \par Cause:
*
* \link #CFE_ES_WRITE_SYSLOG_CC ES Write System Log Command \endlink failed parsing file
* \link #CFE_ES_WRITE_SYS_LOG_CC ES Write System Log Command \endlink failed parsing file
* name or creating the file. OVERLOADED
*/
#define CFE_ES_SYSLOG2_ERR_EID 55
Expand Down Expand Up @@ -772,7 +772,7 @@
*
* \par Cause:
*
* \link #CFE_ES_OVER_WRITE_SYSLOG_CC ES Set System Log Overwrite Mode Command \endlink success.
* \link #CFE_ES_OVER_WRITE_SYS_LOG_CC ES Set System Log Overwrite Mode Command \endlink success.
*/
#define CFE_ES_SYSLOGMODE_EID 70

Expand All @@ -783,7 +783,7 @@
*
* \par Cause:
*
* \link #CFE_ES_OVER_WRITE_SYSLOG_CC ES Set System Log Overwrite Mode Command \endlink failed
* \link #CFE_ES_OVER_WRITE_SYS_LOG_CC ES Set System Log Overwrite Mode Command \endlink failed
* due to invalid mode requested.
*/
#define CFE_ES_ERR_SYSLOGMODE_EID 71
Expand Down
6 changes: 3 additions & 3 deletions modules/es/fsw/src/cfe_es_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,21 @@ void CFE_ES_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr)
}
break;

case CFE_ES_CLEAR_SYSLOG_CC:
case CFE_ES_CLEAR_SYS_LOG_CC:
if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_ClearSysLogCmd_t)))
{
CFE_ES_ClearSysLogCmd((const CFE_ES_ClearSysLogCmd_t *)SBBufPtr);
}
break;

case CFE_ES_WRITE_SYSLOG_CC:
case CFE_ES_WRITE_SYS_LOG_CC:
if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_WriteSysLogCmd_t)))
{
CFE_ES_WriteSysLogCmd((const CFE_ES_WriteSysLogCmd_t *)SBBufPtr);
}
break;

case CFE_ES_OVER_WRITE_SYSLOG_CC:
case CFE_ES_OVER_WRITE_SYS_LOG_CC:
if (CFE_ES_VerifyCmdLength(&SBBufPtr->Msg, sizeof(CFE_ES_OverWriteSysLogCmd_t)))
{
CFE_ES_OverWriteSysLogCmd((const CFE_ES_OverWriteSysLogCmd_t *)SBBufPtr);
Expand Down
12 changes: 6 additions & 6 deletions modules/es/fsw/src/cfe_es_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void CFE_ES_SetupPerfVariables(uint32 ResetType)

/* set data collection state to waiting for command state */
Perf->MetaData.State = CFE_ES_PERF_IDLE;
Perf->MetaData.Mode = CFE_ES_PERF_TRIGGER_START;
Perf->MetaData.Mode = CFE_ES_PerfTrigger_START;
Perf->MetaData.TriggerCount = 0;
Perf->MetaData.DataStart = 0;
Perf->MetaData.DataEnd = 0;
Expand Down Expand Up @@ -155,7 +155,7 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data)
PerfDumpState->PendingState == CFE_ES_PerfDumpState_IDLE)
{
/* Make sure Trigger Mode is valid */
if (CmdPtr->TriggerMode < CFE_ES_PERF_MAX_MODES)
if (CmdPtr->TriggerMode <= CFE_ES_PerfTrigger_END)
{
CFE_ES_Global.TaskData.CommandCounter++;

Expand All @@ -180,7 +180,7 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data)
CFE_ES_Global.TaskData.CommandErrorCounter++;
CFE_EVS_SendEvent(CFE_ES_PERF_STARTCMD_TRIG_ERR_EID, CFE_EVS_EventType_ERROR,
"Cannot start collecting performance data, trigger mode (%d) out of range (%d to %d)",
(int)CmdPtr->TriggerMode, (int)CFE_ES_PERF_TRIGGER_START, (int)CFE_ES_PERF_TRIGGER_END);
(int)CmdPtr->TriggerMode, (int)CFE_ES_PerfTrigger_START, (int)CFE_ES_PerfTrigger_END);
}
}
else
Expand Down Expand Up @@ -668,21 +668,21 @@ void CFE_ES_PerfLogAdd(uint32 Marker, uint32 EntryExit)
if (Perf->MetaData.State == CFE_ES_PERF_TRIGGERED)
{
Perf->MetaData.TriggerCount++;
if (Perf->MetaData.Mode == CFE_ES_PERF_TRIGGER_START)
if (Perf->MetaData.Mode == CFE_ES_PerfTrigger_START)
{
if (Perf->MetaData.TriggerCount >= CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE)
{
Perf->MetaData.State = CFE_ES_PERF_IDLE;
}
}
else if (Perf->MetaData.Mode == CFE_ES_PERF_TRIGGER_CENTER)
else if (Perf->MetaData.Mode == CFE_ES_PerfTrigger_CENTER)
{
if (Perf->MetaData.TriggerCount >= CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE / 2)
{
Perf->MetaData.State = CFE_ES_PERF_IDLE;
}
}
else if (Perf->MetaData.Mode == CFE_ES_PERF_TRIGGER_END)
else if (Perf->MetaData.Mode == CFE_ES_PerfTrigger_END)
{
Perf->MetaData.State = CFE_ES_PERF_IDLE;
}
Expand Down
Loading

0 comments on commit aa4afad

Please sign in to comment.