From 735c4bfedddd6b8374fd27ba527c49d3b86746fc Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 7 Nov 2024 16:05:47 +0800 Subject: [PATCH] add debug options for sussing out IRQ problems in the kernel --- kernel/src/arch/riscv/irq.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 1bc332f66..e665d4770 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -190,17 +190,18 @@ pub extern "C" fn trap_handler( let epc = sepc::read(); let ex = RiscvException::from_regs(sc.bits(), epc, stval::read()); - #[cfg(feature = "debug-print")] + #[cfg(any(feature = "debug-print"))] // , feature = "debug-swap-verbose" { let pid = current_pid(); let ex = RiscvException::from_regs(sc.bits(), sepc::read(), stval::read()); let tid = ArchProcess::with_current(|p| p.current_tid()); println!( - "IRQ ({}.{}): {} sepc {:x}", // reg {:08x?} + "IRQ ({}.{}): {} sepc {:x} sim {:x}", // reg {:08x?} pid, tid, ex, sepc::read(), + sim_read(), // ArchProcess::with_current(|p| p.current_thread().registers) ); }