-
Notifications
You must be signed in to change notification settings - Fork 232
Description
In cfe_es_perf.c in CFE_ES_RunPerfLogDump, on lines 428:429, FileHdr.Length is set to the size of the performance metadata plus the size of the number of entries to be written. FileHdr is immediately passed to CFE_FS_WriteHeader, which promptly overwrites the Length field to the size of itself. The dead write to FileHdr.length in ES should be removed.
When writing the entries, they are only written one at a time. This requires many system calls to write small amounts of data. Aside from how long it takes, this may prematurely wear out flash file systems. The desired behavior as documented in the file is to implement work-throttling as a form of cooperative CPU sharing with the other low priority background jobs. This is admirable, but 12 byte writes is probably too pessimistic. Data should be buffered to write in a platform configurable manner, such that writes can happen in batches of 4096 bytes or 256 entries, for example. This kind of change necessarily makes the implementation more complicated to handle new edge cases, but would greatly improve observable performance (where currently writing a perf log dump takes quite a while compared to how large it is) and mitigate wear on flash storage systems.