Ctrace exception return - #2587
Conversation
Test Results 4 files 4 suites 1s ⏱️ Results for commit 0f8047d. ♻️ This comment has been updated with latest results. |
7e56b3c to
6bc1f4f
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and tests appear consistent with the new exception return/origin semantics, with only minor readability cleanup suggested in a test.
Pull request overview
Updates the ctrace CTF generation and Trace Compass analysis XML to preserve and visualize exception “return” semantics (alongside entered/exited), including distinguishing trace-derived transitions from synthetic lane reconstruction and resetting exception state on discontinuities.
Changes:
- Extend the CTF exception event schema with a
Returnedaction and anExceptionOriginfield, and update encoding/decoding accordingly. - Update exception lane tracking to emit
Enter/Exit/Returntransitions with trace vs synthetic origin, and reset lane state on overflow/data loss. - Enhance Trace Compass XML to add an
EXCEPTION_RETURNlane and order lanes as Thread Mode → Return → per-exception lanes; expand unit/integration tests to cover the new semantics.
File summaries
| File | Description |
|---|---|
| tools/ctrace/test/unit/support/CtfTestSupport.h | Updates test CTF parser payload sizing for the expanded Exception event payload. |
| tools/ctrace/test/unit/src/output/ctf/CtfSchemaTests.cpp | Extends schema density checks and adds/updates lane-tracker behavior tests for return/origin semantics. |
| tools/ctrace/test/unit/src/output/ctf/CtfMetadataWriterTests.cpp | Validates metadata/XML includes new action/origin fields and verifies lane ordering in the generated Trace Compass XML. |
| tools/ctrace/test/unit/src/output/ctf/CtfEncoderTests.cpp | Updates encoder tests to account for the new Exception payload origin byte. |
| tools/ctrace/test/unit/src/output/ctf/CtfBundleOutputTests.cpp | Updates bundle-output tests for return/origin semantics and adds an overflow/discontinuity regression test. |
| tools/ctrace/src/output/ctf/TraceCompassXmlWriter.cpp | Adds EXCEPTION_RETURN state + view entries and adjusts exception view lane ordering and matching. |
| tools/ctrace/src/output/ctf/CtfSchema.h | Adds Returned and ExceptionOrigin to the schema with value helpers. |
| tools/ctrace/src/output/ctf/CtfMetadataWriter.cpp | Updates exception naming (“Thread Mode”) and writes new enums/fields into the CTF metadata. |
| tools/ctrace/src/output/ctf/CtfExceptionLaneTracker.h | Extends lane tracker API to include Return and RecordOrigin, and updates internal helper signatures. |
| tools/ctrace/src/output/ctf/CtfExceptionLaneTracker.cpp | Implements updated lane transition logic (return + origin) and discontinuity handling semantics. |
| tools/ctrace/src/output/ctf/CtfEncoder.h | Updates exception record emission API to include RecordOrigin. |
| tools/ctrace/src/output/ctf/CtfEncoder.cpp | Encodes exception origin into the Exception event payload and resets lane state on overflow/data loss. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
JonatanAntoni
left a comment
There was a problem hiding this comment.
LGTM, see some neat picking comments
|
Thanks, addressed all review comments:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2587 +/- ##
==========================================
+ Coverage 72.33% 72.34% +0.01%
==========================================
Files 185 185
Lines 30317 30334 +17
Branches 17892 17894 +2
==========================================
+ Hits 21929 21946 +17
Misses 6079 6079
Partials 2309 2309
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Fixes
Changes
entered,exited, andreturnedexception actions in CTF output.Returnlane to the Trace Compass analysis.ThreadMode,Return, followed by individual exceptions.Validation
ctrace,CtraceUnitTests, andCtraceIntegTests.Checklist