|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 21 – Debugging, Tracing, and Determinism > 21.4 Subsystem Logging (DEBUG_LOG) |
Every major subsystem includes DEBUG_LOG instrumentation for operational diagnostics. Unlike the EXECTRACE system (which targets architectural trace records), DEBUG_LOG provides human-readable diagnostic output for development and troubleshooting.
Key rule: Every DEBUG_LOG statement includes the CPU identifier when relevant. This is mandatory for SMP debugging — without CPU identification, cross-CPU event correlation is impossible. Examples from the codebase:
DEBUG_LOG(QString("CPU%1: TLB shootdown VA=0x%2 ASN=%3 realm=%4")
.arg(m_cpuId).arg(va, 16, 16, QChar('0')).arg(asn).arg(realm));
DEBUG_LOG(QString("CPU%1: MTPR_SIRR IPL=%2").arg(m_cpuId).arg(ipl));
DEBUG_LOG(QString("PAL INTERRUPT: vector=0x%1, IPL=%2")
.arg(vector, 4, 16, QChar('0')).arg(ipl));
The DEBUG_LOG_CONTEXT variant adds component tagging for filtering: DEBUG_LOG_CONTEXT("CSERVE 0x01 called", "PAL"), DEBUG_LOG_CONTEXT("Instruction fetched", "IBox"). The logging system supports the logWithContext(LogLevel, component, message) interface for structured log records with severity levels.
Subsystem-specific logging covers: CBox barrier stall and release events, FaultDispatcher event queueing, IPIManager send/receive with command type and target CPU, MemoryBarrierCoordinator initiation/acknowledgment/timeout, ReservationManager reservation creation and invalidation with cache line addresses and CPU IDs, IRQPendingState interrupt assertion and delivery, SPAM TLB cache hit/miss/eviction statistics, and device MMIO reads/writes.
See Also: Chapter 11 - Architectural Invariants (debugging invariants and recommended diagnostics).