The CXL subsystem in QEMU currently has no trace coverage: hw/cxl/
does not have its own trace-events file, and there are no trace_*()
calls across hw/cxl/ or hw/mem/cxl_type3.c. Debugging mailbox
commands, HDM decoder programming, CDAT ingestion, event log
activity, and CFMWS address decoding currently relies on temporary
printf instrumentation or qemu_log_mask output. Trace events offer a
more structured mechanism for observing these paths during
development.
This series introduces trace-events infrastructure for the CXL
subsystem and adds 12 trace points covering the paths listed above.
The events all use the cxl_ prefix so a single -trace 'cxl_*'
captures everything. The two cxl_hdm_decoder_* events live in the
existing hw/mem/trace-events alongside the file they trace
(hw/mem/cxl_type3.c); the cxl_ prefix preserves the unified
filtering UX.
Each patch is independent and corresponds to a self-contained debug
scenario:
1/3 trace infrastructure + mailbox dispatch
- cxl_mailbox_command, cxl_mailbox_invalid_payload,
cxl_mailbox_handler_return
2/3 HDM decoder commit + CDAT load
- cxl_hdm_decoder_write, cxl_hdm_decoder_commit,
cxl_cdat_init, cxl_cdat_loaded
3/3 event log + CFMWS HPA -> device decoding
- cxl_event_insert, cxl_event_overflow, cxl_event_clear
- cxl_cfmws_lookup, cxl_cfmws_target_resolved
Junjie Cao (3):
hw/cxl: add trace-events for mailbox dispatch
hw/cxl: trace HDM decoder commit and CDAT load
hw/cxl: trace event log activity and CFMWS address decoding
hw/cxl/cxl-cdat.c | 3 +++
hw/cxl/cxl-events.c | 8 +++++++-
hw/cxl/cxl-host.c | 4 ++++
hw/cxl/cxl-mailbox-utils.c | 5 +++++
hw/cxl/trace-events | 21 +++++++++++++++++++++
hw/cxl/trace.h | 4 ++++
hw/mem/cxl_type3.c | 17 ++++++++++++++++-
hw/mem/trace-events | 4 ++++
meson.build | 1 +
9 files changed, 65 insertions(+), 2 deletions(-)
create mode 100644 hw/cxl/trace-events
create mode 100644 hw/cxl/trace.h
base-commit: 5611a9268dae7b7ff99d478ed134052a9fc7e9f7
--
2.43.0