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

Fix #2410, document ES Perf enums #2411

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion modules/es/config/default_cfe_es_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload
CdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */
} CFE_ES_DeleteCDSCmd_Payload_t;

/**
* @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
};

typedef uint32 CFE_ES_PerfMode_Enum_t;

/**
** \brief Start Performance Analyzer Command Payload
**
Expand All @@ -151,7 +165,7 @@ typedef struct CFE_ES_DeleteCDSCmd_Payload
**/
typedef struct CFE_ES_StartPerfCmd_Payload
{
uint32 TriggerMode; /**< \brief Desired trigger position (Start, Center, End) */
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
34 changes: 18 additions & 16 deletions modules/es/fsw/src/cfe_es_perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@
** Defines
*/

enum CFE_ES_PerfState_t

/** @defgroup CFEESPerf Performance Analyzer Data Structures
* @{
*/

/**
* @brief Internal states for Performance Analyzer
*/
typedef enum CFE_ES_PerfState
{
CFE_ES_PERF_IDLE = 0,
CFE_ES_PERF_WAITING_FOR_TRIGGER,
CFE_ES_PERF_TRIGGERED,
CFE_ES_PERF_MAX_STATES
};

enum CFE_ES_PerfMode_t
{
CFE_ES_PERF_TRIGGER_START = 0,
CFE_ES_PERF_TRIGGER_CENTER,
CFE_ES_PERF_TRIGGER_END,
CFE_ES_PERF_MAX_MODES
};
} CFE_ES_PerfState_t;

/*
* Perflog Dump Background Job states
/**
* @brief Perflog Dump Background Job states
*
* Writing performance log data is now handled by a state machine that runs
* as a background job in Executive services. When a performance log dump is
Expand All @@ -81,8 +81,8 @@ typedef enum
CFE_ES_PerfDumpState_MAX /* Placeholder for last state, no action, always last */
} CFE_ES_PerfDumpState_t;

/*
* Performance log dump state structure
/**
* @brief Performance log dump state structure
*
* This structure is stored in global memory and keeps the state
* of the performance log dump from one iteration to the next.
Expand Down Expand Up @@ -110,8 +110,8 @@ typedef struct
size_t FileSize; /* Total file size, for progress reporting in telemetry */
} CFE_ES_PerfDumpGlobal_t;

/*
* Helper function to obtain the progress/remaining items from
/**
* @brief Helper function to obtain the progress/remaining items from
* the background task that is writing the performance log data
*
* This is no longer just simply reading a single value from a struct,
Expand All @@ -137,4 +137,6 @@ uint32 CFE_ES_GetPerfLogDumpRemaining(void);
*/
bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg);

/** @} */

#endif /* CFE_ES_PERF_H */