|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 9 - SMP Architecture > 9.12 Debugging SMP Behavior |
Deterministic SMP behavior depends on observability. Key debugging principles:
•Always identify CPUId in logs — every DEBUG_LOG in CBox, FaultDispatcher, ReservationManager, and barrier coordination includes the CPU identifier
•Track reservation creation and invalidation — ReservationManager logs setReservation() and breakReservationsOnCacheLine() with cache line addresses and CPU IDs
•Log barrier stall and release events — CBox logs barrier kind, stall entry, and release; MemoryBarrierCoordinator logs initiation, acknowledgment count, and timeout
•Trace IPIs and acknowledgments — IPIManager tracks totalCount per CPU; IPI send/receive is logged with command type and target CPU
•Verify TLB invalidation paths — handleTLBShootdownIPI() logs the invalidation command, VA, and ASN on receipt
•Use CPUStateManager — getAllCPUStatesString() provides a snapshot of all CPU states (Running/Halted/Waiting/Quiesced/Reset)
•ExecutionCoordinator::getSystemStatus() and getCPUStatus(cpuId) provide diagnostic summaries
See Also: Section 3.18 – Instrumentation and Tracing.