Skip to content

CFE ES unnecessarily keeping multiple copies of task/app names #502

@jphickey

Description

@jphickey

Is your feature request related to a problem? Please describe.
When reviewing the changes for other tickets, noted that the CFE ES is storing the app name in the AppTable twice. It is stored in the StartParams.Name subfield, as well as the TaskInfo.MainTaskName sub field. These appear to be always set together, to the same value, such as in CFE_ES_AppCreate for example:

strncpy((char *)CFE_ES_Global.AppTable[i].StartParams.Name, AppName, OS_MAX_API_NAME);

strncpy((char *)CFE_ES_Global.AppTable[i].TaskInfo.MainTaskName, AppName, OS_MAX_API_NAME);

It then goes on to store the same string a third time in the TaskTable[x].TaskName field for the task itself:

strncpy((char *)CFE_ES_Global.TaskTable[TaskId].TaskName,
(char *)CFE_ES_Global.AppTable[i].TaskInfo.MainTaskName,OS_MAX_API_NAME );

The name is a string value and therefore takes a fair bit of memory to store. In the "stock" example config this bloats the size of the ES data structures by about 2500 bytes, but could easily be much more in a real deployment if OS_MAX_API_NAME is set longer and/or the max number of apps/tasks is larger.

Describe the solution you'd like
Should store at most one copy of the name in the AppTable, but even that might not be needed if it is always the same as the main task name (which it appears to be).

For tasks, OSAL already stores the task name. For the ES API calls that need to get the name, it should just lookup the name from OSAL, just like we are doing for SB in #404

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions