You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At some point the perf code that writes the data buffer to a file was rewritten. At this time they changed the logic to reorder the data in the buffer. This is fine except they did not update the MetaData to match the new data buffer order.
The MetaData is used to parse and process the data file. It includes a data start index and a data end index. Since this is a circular buffer the start and end can be anywhere in the buffer, it all depends on when the data collection was stopped. So the data start and data end indicates where in buffer the data starts and ends.
The code that writes the buffer to a file used to just dump the buffer as is to the file. The code now uses the data start index to initialize the first entry in the loop that writes each entry to the file, so the data in the file is now ordered starting with the start entry.
The data start and end index in the metadata is still initialized to the original start and end index values and so now does not match the actual order of the data in the file. This results in the existing applications that read the file will only process entries from the start index to the end of the buffer, skipping entries before the start index. The number of entries that are loaded will vary depending on the location of the start index in the buffer when the data collection was stopped.
At some point the perf code that writes the data buffer to a file was rewritten. At this time they changed the logic to reorder the data in the buffer. This is fine except they did not update the MetaData to match the new data buffer order.
The MetaData is used to parse and process the data file. It includes a data start index and a data end index. Since this is a circular buffer the start and end can be anywhere in the buffer, it all depends on when the data collection was stopped. So the data start and data end indicates where in buffer the data starts and ends.
The code that writes the buffer to a file used to just dump the buffer as is to the file. The code now uses the data start index to initialize the first entry in the loop that writes each entry to the file, so the data in the file is now ordered starting with the start entry.
The data start and end index in the metadata is still initialized to the original start and end index values and so now does not match the actual order of the data in the file. This results in the existing applications that read the file will only process entries from the start index to the end of the buffer, skipping entries before the start index. The number of entries that are loaded will vary depending on the location of the start index in the buffer when the data collection was stopped.
Solution: Don't reorder the entries in the buffer
File: cfe_es_perf.c
Function: CFE_ES_RunPerfLogDump
Change:
case CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES:
State->DataPos = Perf->MetaData.DataStart;
State->StateCounter = Perf->MetaData.DataCount;
break;
to:
case CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES:
State->DataPos = 0;
State->StateCounter = Perf->MetaData.DataCount;
break;
Steven Slegel
The text was updated successfully, but these errors were encountered: