From b4ddf4c86bcb759a6a348a4314a54eb6656b32b2 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 31 Mar 2019 18:31:56 +0100 Subject: [PATCH] firmware: Make "unexpected reply from kernel CPU" log messages unique This makes it easier to localize issues based on the log output. --- artiq/firmware/runtime/session.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index c0498ef4a..4947fe17c 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -221,7 +221,7 @@ unsafe fn kern_load(io: &Io, session: &mut Session, library: &[u8]) Err(Error::Load(format!("{}", error))) } other => - unexpected!("unexpected reply from kernel CPU: {:?}", other) + unexpected!("unexpected kernel CPU reply to load request: {:?}", other) } }) } @@ -272,7 +272,8 @@ fn process_host_message(io: &Io, let slot = kern_recv(io, |reply| { match reply { &kern::RpcRecvRequest(slot) => Ok(slot), - other => unexpected!("unexpected reply from kernel CPU: {:?}", other) + other => unexpected!( + "expected root value slot from kernel CPU, not {:?}", other) } })?; rpc::recv_return(stream, &tag, slot, &|size| -> Result<_, Error> { @@ -280,7 +281,8 @@ fn process_host_message(io: &Io, Ok(kern_recv(io, |reply| { match reply { &kern::RpcRecvRequest(slot) => Ok(slot), - other => unexpected!("unexpected reply from kernel CPU: {:?}", other) + other => unexpected!( + "expected nested value slot from kernel CPU, not {:?}", other) } })?) })?; @@ -299,8 +301,8 @@ fn process_host_message(io: &Io, kern_recv(io, |reply| { match reply { &kern::RpcRecvRequest(_) => Ok(()), - other => - unexpected!("unexpected reply from kernel CPU: {:?}", other) + other => unexpected!( + "expected (ignored) root value slot from kernel CPU, not {:?}", other) } })?;