From 2b05626b69bba326541b5f1f97291b550c4bf219 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 15 May 2024 02:42:29 +0800 Subject: [PATCH] add context switching debug option --- kernel/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 573f9da3a..eb565668f 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -105,12 +105,14 @@ pub extern "C" fn kmain() { } loop { + #[cfg(feature = "debug-print")] + let last_pid = pid; pid = next_pid_to_run(pid); match pid { Some(pid) => { - // #[cfg(feature = "debug-print")] - // println!("switching to pid {}", pid); + #[cfg(feature = "debug-print")] + println!(" PID{:?}->{:?}", last_pid.unwrap_or(0), pid); // keep this succinct as it happens often xous_kernel::rsyscall(xous_kernel::SysCall::SwitchTo(pid, 0)) .expect("couldn't switch to pid"); }