From 44b37aba7d03d80e009ff6ce93a5324cdbe34f59 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 26 Apr 2020 16:10:09 +0800 Subject: [PATCH] improve debug messaging --- runtime/src/comms.rs | 3 ++- runtime/src/kernel.rs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/src/comms.rs b/runtime/src/comms.rs index 8d3ddf9a..5f15bb95 100644 --- a/runtime/src/comms.rs +++ b/runtime/src/comms.rs @@ -3,7 +3,7 @@ use core::fmt; use core::cmp::min; use core::cell::RefCell; use alloc::rc::Rc; -use log::{warn, error}; +use log::{debug, warn, error}; use num_derive::{FromPrimitive, ToPrimitive}; use num_traits::{FromPrimitive, ToPrimitive}; @@ -105,6 +105,7 @@ async fn write_header(stream: &TcpStream, reply: Reply) -> Result<()> { async fn handle_connection(stream: &TcpStream, control: Rc>) -> Result<()> { expect(&stream, b"ARTIQ coredev\n").await?; + debug!("received connection"); loop { if !expect(&stream, &[0x5a, 0x5a, 0x5a, 0x5a]).await? { return Err(Error::UnexpectedPattern) diff --git a/runtime/src/kernel.rs b/runtime/src/kernel.rs index 7db95557..d20d2d3c 100644 --- a/runtime/src/kernel.rs +++ b/runtime/src/kernel.rs @@ -125,6 +125,7 @@ pub fn main_core1() { ptr::write_bytes(__bss_start as *mut u8, 0, (_end - __bss_start) as usize); } current_modinit = Some(__modinit__); + debug!("kernel loaded"); core1_tx.send(Message::LoadCompleted) }, Err(error) => { @@ -134,13 +135,13 @@ pub fn main_core1() { } }, Message::StartRequest => { - debug!("starting"); + debug!("kernel starting"); if let Some(__modinit__) = current_modinit { unsafe { (mem::transmute::(__modinit__))(); } } - debug!("stopping"); + debug!("kernel terminated"); } _ => error!("Core1 received unexpected message: {:?}", message), }