Skip to content

feat(ctrace): process all trace channels per solution set - #2633

Merged
thorstendb-ARM merged 8 commits into
mainfrom
feat/ctrace-multiple-channels
Sep 23, 2026
Merged

thorstendb-ARM merged 8 commits into
mainfrom
feat/ctrace-multiple-channels

Conversation

@thorstendb-ARM

@thorstendb-ARM thorstendb-ARM commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Remove the single-input restriction for coexisting SWO and Trace Buffer captures of one solution set.
Related: #2573 and cmsis-toolbox #699.

Changes

  • Process every matching SWO, TB, and TB_<name> input independently and sequentially, in deterministic order.
    --target selects the solution set; without it, all discovered sets are processed.
  • Preflight each input separately: SWO defaults to unformatted, TB/named-TB to formatted.
    An explicit format override still applies to all inputs in its configuration.
  • Generate <solution-set>.<channel>.csv and <solution-set>.<channel>.ctf per input.
    One optional <solution-set>.traceanalysis.xml collects graphical views from eligible completed bundles.
  • Scope XML state by clock UUID and Trace Bus ID, with channel/processor display labels and distinct analysis/view IDs.
    Only topics backed by emitted data generate views; point events remain in the standard CTF event table.
  • Keep one file job and OpenCSD tree active at a time. Decoder state, clocks, filters and output artifacts remain local
    to each input. Failures retain a nonzero exit status while remaining inputs and solution sets continue.
  • Keep XML failures independent of completed CSV/CTF outputs. Extend tests, architecture MD/SVG and output contracts.
    Add the repository's AI-generation notice to all five new C++ files.

Compatibility and scope

  • CTF paths change even for single-input runs: Board.ctf becomes Board.SWO.ctf.
    Consumers must adapt; existing target-only bundles and historical per-channel XML files are not migrated or deleted.
  • The published specification still names <solution-set>.ctf; channel-qualified naming remains a specification
    alignment task.
  • Shared XML accepts completed bundles with one retained clock domain each. Multi-clock bundles remain valid CTF but
    are excluded from XML with a warning. No clock correlation, timestamp rebasing or trace-data merge is introduced.
  • No new --channel option, decoder or binary event-layout change. Event Recorder inputs remain warned/skipped.
    No output option still means validation only.

Validation

  • Full CI at 3e26087c passed:
    native Linux AMD64, Windows AMD64 and macOS Arm64 tests; Linux/Windows Arm64 compile-only checks;
    Babeltrace consumer validation and 100% ctrace source-line coverage.
  • Tests cover coexisting SWO/TB/named-TB outputs, multiple targets, filters, shared XML and view isolation,
    missing sync, input-specific metadata/framing failures, output-path failures and unaffected artifacts.
    The dedicated all-targets/all-outputs test checks generated filenames without duplicating decoder golden outputs.
  • This review follow-up changes only header comments and documentation. Markdownlint, SVG XML validation,
    unchanged-code verification and git diff --check pass.

Checklist

  • Tests and documentation updated.
  • Output isolation, safe replacement and error handling covered.
  • No third-party dependency or TPIP changes.

Decode matching SWO, TB, and named-TB captures independently and continue after per-input failures. Qualify CTF bundle names with the channel to match CSV/XML output naming and prevent overwrites.

Cover multi-channel selection, output modes, filters, failure isolation, and independent metadata. Update architecture and document the CTF path compatibility change.
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Test Results

    6 files      6 suites   9s ⏱️
  485 tests   485 ✅  0 💤 0 ❌
1 455 runs  1 438 ✅ 17 💤 0 ❌

Results for commit 0231634.

♻️ This comment has been updated with latest results.

Collect graphical views from completed per-channel CTF bundles in one target-level XML, with capture-clock and trace-bus routing isolation.

Separate the XML lifecycle from CTF bundles, share output-path validation, and cover multi-channel, multi-target and failure scenarios with tests and documentation.
edriouk pushed a commit that referenced this pull request Sep 23, 2026
## Summary

- Exclude component coverage checks when no fresh flag report was
uploaded for the commit, including carried-forward reports.
- Keep carryforward data, coverage targets, thresholds, and upload
failure handling unchanged.
- Prevent false cross-component regressions such as the SVDConv check in
#2633 after merging #2634.

## Validation

- Official Codecov YAML validator: `Valid!`.
- `git diff --check` passed. Only `codecov.yml` changes; no source or
workflow changes.
Accept platform-specific rejection stages for overlong CTF and XML paths while still requiring an exception. Add an all-target, all-channel regression checking CSV, CTF and shared XML output names and types.

@jreineckearm jreineckearm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks mostly good, notices about AI generated files are missing in new files.
Going to test now.

Comment thread tools/ctrace/src/output/ctf/TraceCompassXmlOutput.cpp
Comment thread tools/ctrace/src/output/ctf/TraceCompassXmlOutput.h
Comment thread tools/ctrace/src/output/OutputPath.cpp

@jreineckearm jreineckearm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality looks good. Happy to approve once the AI notices are added to new source files

Add Generated with AI notices to all five new C++ files. Clarify per-input backend setup and route-local event buffering in the architecture, diagram and runtime constraints.
@thorstendb-ARM

Copy link
Copy Markdown
Contributor Author

Thanks for testing, @jreineckearm. The AI notices were added in 20c02fd. Rechecked all 125 tracked ctrace C++ source/header/test files, including all 28 changed files and the five new ones: no notices missing. All three inline comments are answered.

The remaining review found no functional issues; one stale output-path statement was corrected in 3a13398. The ctrace build/test and coverage jobs passed at 20c02fd.

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.69%. Comparing base (3c16c5c) to head (0231634).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2633      +/-   ##
==========================================
- Coverage   78.68%   74.69%   -3.99%     
==========================================
  Files         197      199       +2     
  Lines       32778    32802      +24     
  Branches    19152    19167      +15     
==========================================
- Hits        25790    24502    -1288     
- Misses       4662     6000    +1338     
+ Partials     2326     2300      -26     
Flag Coverage Δ
ctrace-cov 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tools/ctrace/src/control/FileDecodeJob.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/control/TraceDirectoryJob.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/OutputPath.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/OutputRequirements.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/TraceOutputConfig.h 100.00% <100.00%> (ø)
tools/ctrace/src/output/ctf/CtfBundleOutput.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/ctf/CtfMetadataModel.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/ctf/CtfMetadataWriter.cpp 100.00% <100.00%> (ø)
...ls/ctrace/src/output/ctf/TraceCompassXmlOutput.cpp 100.00% <100.00%> (ø)
...ls/ctrace/src/output/ctf/TraceCompassXmlWriter.cpp 100.00% <100.00%> (ø)
... and 3 more

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jreineckearm jreineckearm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks for fixing the copyright headers!

@thorstendb-ARM
thorstendb-ARM merged commit ce6763d into main Sep 23, 2026
23 checks passed
@thorstendb-ARM
thorstendb-ARM deleted the feat/ctrace-multiple-channels branch September 23, 2026 14:52
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.

2 participants