From 2f7196679f0c79920bd24837d23e883cb7272338 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 9 May 2026 16:06:41 +0800 Subject: [PATCH] add some debug telemetry on process termination --- kernel/src/arch/riscv/irq.rs | 2 ++ kernel/src/services.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 7df889327..84df3024c 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -555,6 +555,8 @@ pub extern "C" fn trap_handler( println!("Program suspended. You may inspect it using gdb."); } #[cfg(not(feature = "gdb-stub"))] + println!("Process {:?} terminated", pid); + #[cfg(not(feature = "gdb-stub"))] ss.terminate_process(pid).expect("couldn't terminate current process"); crate::syscall::reset_switchto_caller(); }); diff --git a/kernel/src/services.rs b/kernel/src/services.rs index 1ccd9cadc..fe5b89e2d 100644 --- a/kernel/src/services.rs +++ b/kernel/src/services.rs @@ -2184,6 +2184,7 @@ impl SystemServices { /// Terminate the given process. Returns the process' parent PID. pub fn terminate_process(&mut self, target_pid: PID) -> Result { + println!("terminate_process: {:?}", target_pid); // To terminate a process, we must perform the following: // // 1. If we have any client connections, remove them.