From 6e312ffc8a13d5f2442dd5eebc00a64f06d7a367 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 30 Oct 2020 20:42:57 +0800 Subject: [PATCH] kernel: process: only print process inits when printing is enabled Signed-off-by: Sean Cross --- kernel/src/arch/riscv/process.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/src/arch/riscv/process.rs b/kernel/src/arch/riscv/process.rs index c4f439809..459206ab2 100644 --- a/kernel/src/arch/riscv/process.rs +++ b/kernel/src/arch/riscv/process.rs @@ -299,9 +299,10 @@ impl Process { thread.registers[1] = thread_init.stack.as_ptr() as usize + thread_init.stack.len(); thread.registers[9] = thread_init.arg.map(|x| x.get()).unwrap_or_default(); + #[cfg(any(feature = "debug-print", feature = "print-panics"))] if pid != 1 { - println!( - "Initializing PID {} thread {} with entrypoint {:08x}, stack @ {:08x}, arg {:08x}", + print!( + " [initializing PID {} thread {} with entrypoint {:08x}, stack @ {:08x}, arg {:08x}]", pid, tid, thread.sepc, thread.registers[1], thread.registers[9], ); }