Skip to content

feat(ctrace): output DWT and PMU event counters - #2591

Merged
thorstendb-ARM merged 1 commit into
mainfrom
dev-dwt-event
Sep 4, 2026
Merged

feat(ctrace): output DWT and PMU event counters#2591
thorstendb-ARM merged 1 commit into
mainfrom
dev-dwt-event

Conversation

@thorstendb-ARM

Copy link
Copy Markdown
Contributor

Summary

Add CSV, CTF, and Trace Compass output for architectural DWT event counters and PMU trace-on-overflow packets.

Changes

  • Validate DWT event-counter payloads:
    • exactly one byte
    • non-zero mask
    • only architectural bits 0..5
  • Validate PMU event-counter payloads:
    • exactly one byte
    • non-zero mask
    • bits 0..7
  • Preserve the hardware mask as one CSV row.
  • Expand each set mask bit into an individual timestamped CTF event.
  • Use architectural DWT counter names:
    • CPICNT
    • EXCCNT
    • SLEEPCNT
    • LSUCNT
    • FOLDCNT
    • CYCCNT
  • Represent PMU counters provisionally as Event0 through Event7.
  • Add Trace Compass tables and timelines with short visualization pulses.
  • Add decoder, CSV, CTF, metadata, XML, selection, and integration tests.
  • Add a compact real-world DWT event-counter trace fixture containing mixed events, SLEEPCNT, synchronization, and an overflow boundary.
  • Update the architecture and follow-up documentation.

Output semantics

CSV retains one row per hardware packet and stores the original mask in value.

CTF expands the mask into one event per set bit. The event field contains the bit index (0..5 for DWT and 0..7 for PMU), allowing Trace Compass to provide named counter lanes.

PMU event names remain generic until the programmable counter assignments can be resolved from trace-run configuration.

Validation

  • Debug build and tests: passed
  • Release build and tests: passed
  • CtraceUnitTests: passed
  • CtraceIntegTests: passed
  • CLI integration tests: passed
  • Generated Trace Compass XML validated with xmllint
  • Generated CTF successfully read with Babeltrace
  • git diff --check: clean

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.54%. Comparing base (9662836) to head (12af5c0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2591      +/-   ##
==========================================
+ Coverage   72.40%   72.54%   +0.14%     
==========================================
  Files         185      185              
  Lines       30399    30559     +160     
  Branches    17928    17992      +64     
==========================================
+ Hits        22011    22170     +159     
- Misses       6079     6080       +1     
  Partials     2309     2309              
Flag Coverage Δ
ctrace-cov 99.79% <100.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
tools/ctrace/src/decode/DwtPacketDecoder.cpp 100.00% <100.00%> (ø)
...ools/ctrace/src/diagnostics/TraceIssueReporter.cpp 100.00% <ø> (ø)
tools/ctrace/src/model/TraceEvent.h 100.00% <100.00%> (ø)
tools/ctrace/src/model/TraceSelection.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/csv/CsvRowMapper.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/ctf/CtfEncoder.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/ctf/CtfMetadataWriter.cpp 100.00% <100.00%> (ø)
tools/ctrace/src/output/ctf/CtfSchema.h 100.00% <100.00%> (ø)
...ls/ctrace/src/output/ctf/TraceCompassXmlWriter.cpp 98.68% <100.00%> (-1.32%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Test Results

  4 files    4 suites   2s ⏱️
202 tests 202 ✅ 0 💤 0 ❌
404 runs  397 ✅ 7 💤 0 ❌

Results for commit 12af5c0.

Comment thread tools/ctrace/src/decode/DwtPacketDecoder.cpp
Comment thread tools/ctrace/src/output/csv/CsvRowMapper.cpp
Comment thread tools/ctrace/src/output/ctf/CtfEncoder.cpp
@thorstendb-ARM
thorstendb-ARM merged commit a46c6e4 into main Sep 4, 2026
27 of 28 checks passed
@thorstendb-ARM
thorstendb-ARM deleted the dev-dwt-event branch September 4, 2026 07:42
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