Repository navigation
feat(ctrace): centralize diagnostics and add verbose CLI mode - #2638
Merged
Merged
Conversation
Preserve typed diagnostic parameters through decoder, recovery and abort paths. Render compact CSV notes and retain detailed CLI wording, including byte-skip causes. Centralize CLI-only diagnostics, document the message-system design and coverage audit, and update catalog, transport and output regression tests.
Test Results 6 files 12 suites 11s ⏱️ Results for commit 1a9233c. ♻️ This comment has been updated with latest results. |
Move detailed and compact templates into one validated C++17 catalog. Keep typed adapters and preserve output contracts, restore empty initialization diagnostics, extend error and CSV escaping coverage, and correct public documentation.
Restore the requested carry-over clarification: issue #2573 is closed, while public channel selection and transport format/framing remain separate follow-up work.
Keep the public interface focused on formatting. Derive expected argument counts independently in catalog tests instead of exposing production functions solely for tests.
Use explicit cursor loops for template scanning and rendering. Keep constexpr-only validation helpers inline in a dedicated implementation namespace, with catalog storage and runtime helpers private. Preserve compile-time validation and output behavior.
Build the detailed fields directly in their destination vector and move it into the reporter. This retains the explicit sample-offset formatter call while avoiding const initializer-list copies and an uncovered GCC source-line attribution on that temporary. Values and order stay unchanged.
Build the bounded offset list directly in finish() and remove its single-use static helper. The previous explicit call still triggered CodeQL despite runtime coverage proving the function was exercised. Keep the same values and field order without suppressing the diagnostic or exporting a private implementation detail.
Integrate the ctrace-ref to ref rename from #2637 while preserving the central message catalog and compact/verbose diagnostic behavior. Resolve fixture integrity hashes for renamed YAML and compact CSV. Validation: macOS arm64 Release build; all seven ctrace CTest entries pass.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2638 +/- ##
==========================================
+ Coverage 78.69% 79.00% +0.30%
==========================================
Files 199 207 +8
Lines 32802 33279 +477
Branches 19167 19311 +144
==========================================
+ Hits 25814 26291 +477
Misses 4661 4661
Partials 2327 2327
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
5 tasks done
ReinhardKeil
pushed a commit
to Open-CMSIS-Pack/cmsis-toolbox
that referenced
this pull request
Oct 1, 2026
## Changes Document `ctrace --verbose` / `-v` in the CLI option list and briefly explain detailed stderr diagnostics versus the default compact messages. Companion specification for [devtools #2638](Open-CMSIS-Pack/devtools#2638). Checked with MkDocs build, rendered-section inspection, and `git diff --check`. Markdownlint reports no new findings relative to `main` (45 existing findings). ## Checklist - [x] 🤖 Unit tests: not applicable; documentation only. - [x] 🤹 Manual verification: documentation build and rendered section checked. - [x] 🛡️ Security impacts considered; documentation only. - [x] 📖 Documentation updates complete. - [x] 🧠 No third-party dependency or TPIP changes.
jreineckearm
approved these changes
Oct 1, 2026
jreineckearm
left a comment
There was a problem hiding this comment.
LGTM, probably have another look after the next drop if more can be refactored in the central parts of the messaging system. Then you could also consider calling it logging as messaging could also mean asynchronous message posting.
This was referenced Oct 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
CSV and normal CLI trace diagnostics now share compact cause/count text.
--verbose/-vadds native decoderdetails and bounded RAW-file inspection context; CSV remains compact in both modes.
MessageCatalog.inc, with generated IDs, compact/detailed text, typedparameter adapters and C++17 format validation. No new dependencies.
windows are limited to 128 bytes, clipped to the input size and frame-aligned for formatted input. Packet previews
contain at most 16 bytes with explicit truncation and file/deformatted provenance.
positions stay unknown. Verbose input context includes absolute path, size, format/framing, configuration and version;
ambiguous values are quoted/escaped.
actionable causes. Configuration/statistics information requires verbose; byte-skip information remains visible normally.
tools/ctrace/docs/message-system-design.md.No CSV column or CTF schema changes.
Output example
Actual Release CSV diagnostic from
trace-event.raw:Normal CLI uses the same message:
Verbose output adds
overflow_count=1,raw_offset=9998,position_kind=exact, SYNC offsets0/9999andread_offset=9934/read_length=128. Overflow alone remains non-failing (exit 0). Inspect the window withxxd:
For formatted TB input, positions are formatter hints and packet bytes are deformatted payload, not a contiguous file
range. Read windows are inspection aids, not guaranteed standalone replay captures. Recovery spans count affected RAW
bytes separately from skipped protocol payload.
Checklist