fix(ctrace): accept default TB captures and report skipped payload - #2624
Conversation
Resolve absent trace-format from the selected input before route normalization: formatted for TB channels and unformatted for SWO, while retaining explicit overrides. Allow initial unassigned formatter payload, account for skipped source and initial unsynchronized bytes, and retain timestamp-free CSV info rows independently of event filters. Keep missing synchronization as a separate decoding error and use packet-neutral skip wording. Add regression coverage and update architecture, constraints, and output documentation. Validated with the Release build, all seven ctrace CTest groups, and the Jens TB capture.
Report processed input bytes and trace/diagnostic records instead of claiming that every record is a decoded event. Clarify that counters are collected before output filtering. Extend integration assertions for info-only and error-only input and preserve the counters for captured SWO traces. Validated with the Release build, all seven ctrace CTest groups, and three real TB captures.
Test Results 6 files 6 suites 6s ⏱️ Results for commit 68004cd. ♻️ This comment has been updated with latest results. |
Use size_t for skipped-source array traversal and narrow only at the source-ID interface. Remove source-ID-loss and replay-accounting paths that are unreachable with the configured OpenCSD frontend, and document the invariant. Cover normalized setup warnings, optional skip callbacks, invalid route configuration, and source-ID retention across frame and route resets. Validation: 100% source-line coverage (6508/6508) with the unchanged Linux CI gate; 8/8 Linux and 7/7 macOS ctrace test groups pass.
Preserve native OpenCSD packet context and report explicit recovery outcomes. Keep committed CSV rows with an unfiltered abort marker after fatal decode failures while removing incomplete CTF output. Extend regression coverage, reconcile documentation and the architecture diagram, and publish the concise single-source to multi-ID design record.
Remove unused DecodeConsumers::abortOutputs and the now-unneeded TraceOutputLifecycle::abort forwarding method after fatal decoding moved to finishOutputs with TraceDecodeAbort. Exercise fatal-output finalization and destructor cleanup in the corresponding tests. This removes the cppcheck unusedFunction finding without suppressions or workflow changes.
jreineckearm
left a comment
There was a problem hiding this comment.
Two comments from code review. Rest of the code looks good.
Taking for a manual test now.
jreineckearm
left a comment
There was a problem hiding this comment.
Testing looks good, I'd be fine with keeping the trace-formatter provision in for the time being. But as mentioned in my comment I don't see it becoming part of the spec.
Document trace-format as a private temporary override without assuming standardization, and align the input-contract follow-up with cmsis-toolbox #699. Move packaging and SHA256SUMS details from third-party notices to the architecture documentation.
Preserve TB byte-skip diagnostics while incorporating PC-sampling markers from #2629. Resolve fixture inventory, route-selection test and documentation conflicts. Verify the marker-only CSV output including NULL-source padding annotations and remove obsolete marker limitations.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2624 +/- ##
==========================================
+ Coverage 74.51% 74.67% +0.16%
==========================================
Files 197 197
Lines 32562 32778 +216
Branches 19036 19152 +116
==========================================
+ Hits 24262 24478 +216
+ Misses 6000 5997 -3
- Partials 2300 2303 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jreineckearm
left a comment
There was a problem hiding this comment.
Thanks for the updates, reviewed them. No need to retest as pretty much all was in documentation files. Good to merge.
Fixes
trace-formatdeclaration is missing or null.Changes
unformatted ITM. Explicit declarations retain precedence; input selection remains unambiguous.
reserved, or unconfigured source IDs, plus initial routed bytes before real hardware synchronization.
inforows, independently of--typeand--streamfilters. These annotations do not create synthetic routes or CTF events.retaining completed diagnostics and healthy-route outputs. Genuine framing failures still abort outputs.
rather than claiming that every record represents a decoded payload event.
Validation
Native macOS arm64 Release build passed.
All seven ctrace CTest groups passed: 377 unit tests passed with five platform-specific skips,
37 integration tests passed, plus fixture integrity and executable/manifest smoke checks.
Regression coverage includes channel defaults and overrides, incomplete frames, exact byte accounting,
chunk boundaries, late/missing synchronization, independent routes, filtering, output failures,
legacy raw SWO golden outputs, and the reconstructed multi-source TB fixture.
Three additional real TB captures were checked locally with
--csv:The latter two captures have no routed payload after their first SYNC; they are not successful PC-sample decodes.
Changed Markdown files, SVG XML syntax, and
git diff --checkpassed.Scope and limitations
mechanism for every possible decoder-recovery loss.
trace-formatremains a provisional ctrace-private field, not a newly standardized producer requirement.Checklist