Repository navigation
ctrace: define instruction trace design and correct OpenCSD Thumb-16 reads - #2698
thorstendb-ARM wants to merge 7 commits into
Conversation
Test Results 6 files 12 suites 16s ⏱️ Results for commit a5e008c. ♻️ This comment has been updated with latest results. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2698 +/- ##
==========================================
- Coverage 87.53% 87.45% -0.08%
==========================================
Files 208 208
Lines 33657 33552 -105
==========================================
- Hits 29462 29344 -118
- Misses 4195 4208 +13
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
Trace-domain owner review is needed to validate the cancellation, EOT, and hardware acceptance contracts against reference artifacts unavailable in this repository.
No open issues 🎉
What changed in this PR
This PR prepares ctrace for future instruction-trace support by defining its implementation contract and fixing OpenCSD’s rejection of complete Thumb-16 instructions at image boundaries. Production ctrace ETM integration remains pending.
Changes:
- Adds an independently applied OpenCSD patch for short instruction reads in ETMv3, ETMv4 and PTM, while preserving rejection of incomplete instructions.
- Adds 21 boundary regression tests covering Thumb instructions and fixed-width instruction controls.
- Documents M4/M7 configuration, CSV output, completion behavior, acceptance criteria and remaining decoder limitations.
| File | Description |
|---|---|
tools/ctrace/test/unit/src/decode/OpenCsdInstructionBoundaryTests.cpp |
Adds instruction-boundary regression coverage. |
tools/ctrace/test/unit/CMakeLists.txt |
Registers the new regression test source. |
tools/ctrace/docs/THIRD_PARTY_NOTICES.md |
Documents both local OpenCSD patches. |
tools/ctrace/docs/opencsd-issues.md |
Records decoder defects, reproduction evidence and patch validation. |
tools/ctrace/docs/instruction-trace-design.md |
Defines the instruction-trace implementation contract and qualification gates. |
tools/ctrace/cmake/dependencies/OpenCSD-thumb-fetch.patch |
Allows complete Thumb-16 instructions after short memory reads. |
tools/ctrace/cmake/dependencies/ConfigureOpenCSD.cmake |
Applies each OpenCSD patch independently during configuration. |
Review effort: Balanced
Changes
OpenCSD 1.8.3 rejects complete Thumb-16 instructions when fewer than four image bytes remain. Apply a separate patch for ETMv3, ETMv4 and PTM, with automatic CMake integration and boundary regressions.
The instruction trace implementation spec defines M4/M7 configuration, CSV output, completion and acceptance criteria. The OpenCSD issue notes describe decoder defects and reproduction evidence; the third-party notices document the applied patches. Production ctrace ETM integration remains pending.
Validation
macOS arm64 Release: all 21 boundary regressions and all seven ctrace CTest entries pass. Eight valid Thumb-16 cases fail before the patch; repeated CMake configuration preserves both patches.
Checklist