Skip to content

Fix #2637, write perf log data in raw buffer order#2681

Open
heathdutton wants to merge 1 commit intonasa:mainfrom
heathdutton:fix-2637-perf-log-metadata-mismatch
Open

Fix #2637, write perf log data in raw buffer order#2681
heathdutton wants to merge 1 commit intonasa:mainfrom
heathdutton:fix-2637-perf-log-metadata-mismatch

Conversation

@heathdutton
Copy link

Checklist (Please check before submitting)

Describe the contribution
The perf log dump reorders data entries by starting the write loop from MetaData.DataStart, but the metadata written to the file still contains the original DataStart/DataEnd indices. Consumers that use those indices to parse the file end up skipping entries.

Testing performed

  1. Built within cFS bundle with SIMULATION=native ENABLE_UNIT_TESTS=true
  2. Ran ES unit tests -- all 1346 pass, including all 122 perf-specific tests

Expected behavior changes

  • Behavior Change: Perf log file now contains data in raw circular buffer order (index 0 through N) instead of reordered from DataStart. The metadata indices are now consistent with the data layout, so existing perf log tools will correctly process all entries.

System(s) tested on

  • OS: Ubuntu 22.04 (via cFS bundle build)

Additional context
One-line fix: changed State->DataPos = Perf->MetaData.DataStart to State->DataPos = 0 in CFE_ES_RunPerfLogDump. This stops the reordering so the raw buffer layout matches the metadata that was already being written as-is.

Third party code
N/A

Contributor Info - All information REQUIRED for consideration of pull request
Heath Dutton / Personal

The perf log dump was reordering entries by starting from
DataStart, but the metadata written to the file still contained
the original DataStart/DataEnd indices. This caused consumers
to skip entries when parsing the file. Start the dump at index 0
so the file data matches the metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid MetaData in CFE_es_perf

1 participant