From 070fed755bd1817ed2bb292d4a14a2ead5fc12e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=84=9A=20=E5=AF=8C=E8=89=AF?= Date: Mon, 9 Jan 2023 16:13:05 +0800 Subject: [PATCH] firmware: unify RTIO error message format --- artiq/firmware/runtime/rtio_mgt.rs | 12 ++++++------ artiq/firmware/runtime/session.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/artiq/firmware/runtime/rtio_mgt.rs b/artiq/firmware/runtime/rtio_mgt.rs index 41dbcb42a..92aaaf66a 100644 --- a/artiq/firmware/runtime/rtio_mgt.rs +++ b/artiq/firmware/runtime/rtio_mgt.rs @@ -220,15 +220,15 @@ pub mod drtio { destination_set_up(routing_table, up_destinations, destination, false), Ok(drtioaux::Packet::DestinationOkReply) => (), Ok(drtioaux::Packet::DestinationSequenceErrorReply { channel }) => { - error!("[DEST#{}] RTIO sequence error involving channel {} 0x{:04x}", destination, resolve_channel_name(channel as u32), channel); + error!("[DEST#{}] RTIO sequence error involving channel 0x{:04x}:{}", destination, channel, resolve_channel_name(channel as u32)); unsafe { SEEN_ASYNC_ERRORS |= ASYNC_ERROR_SEQUENCE_ERROR }; } Ok(drtioaux::Packet::DestinationCollisionReply { channel }) => { - error!("[DEST#{}] RTIO collision involving channel {} 0x{:04x}", destination, resolve_channel_name(channel as u32), channel); + error!("[DEST#{}] RTIO collision involving channel 0x{:04x}:{}", destination, channel, resolve_channel_name(channel as u32)); unsafe { SEEN_ASYNC_ERRORS |= ASYNC_ERROR_COLLISION }; } Ok(drtioaux::Packet::DestinationBusyReply { channel }) => { - error!("[DEST#{}] RTIO busy error involving channel {} 0x{:04x}", destination, resolve_channel_name(channel as u32), channel); + error!("[DEST#{}] RTIO busy error involving channel 0x{:04x}:{}", destination, channel, resolve_channel_name(channel as u32)); unsafe { SEEN_ASYNC_ERRORS |= ASYNC_ERROR_BUSY }; } Ok(packet) => error!("[DEST#{}] received unexpected aux packet: {:?}", destination, packet), @@ -355,15 +355,15 @@ fn async_error_thread(io: Io) { let errors = csr::rtio_core::async_error_read(); if errors & ASYNC_ERROR_COLLISION != 0 { let channel = csr::rtio_core::collision_channel_read(); - error!("RTIO collision involving channel {}:{}", channel, resolve_channel_name(channel as u32)); + error!("RTIO collision involving channel 0x{:04x}:{}", channel, resolve_channel_name(channel as u32)); } if errors & ASYNC_ERROR_BUSY != 0 { let channel = csr::rtio_core::busy_channel_read(); - error!("RTIO busy error involving channel {}:{}", channel, resolve_channel_name(channel as u32)); + error!("RTIO busy error involving channel 0x{:04x}:{}", channel, resolve_channel_name(channel as u32)); } if errors & ASYNC_ERROR_SEQUENCE_ERROR != 0 { let channel = csr::rtio_core::sequence_error_channel_read(); - error!("RTIO sequence error involving channel {}:{}", channel, resolve_channel_name(channel as u32)); + error!("RTIO sequence error involving channel 0x{:04x}:{}", channel, resolve_channel_name(channel as u32)); } SEEN_ASYNC_ERRORS = errors; csr::rtio_core::async_error_write(errors); diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index e942d7bd9..c0f009a96 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -457,7 +457,7 @@ fn process_kern_message(io: &Io, aux_mutex: &Mutex, } else { let msg = str::from_utf8(unsafe { slice::from_raw_parts(exn.message.as_ptr(), exn.message.len()) }) .unwrap() - .replace("{rtio_channel_info:0}", &format!("{}:{}", exn.param[0], resolve_channel_name(exn.param[0] as u32))); + .replace("{rtio_channel_info:0}", &format!("0x{:04x}:{}", exn.param[0], resolve_channel_name(exn.param[0] as u32))); Some(eh::eh_artiq::Exception { id: exn.id, file: exn.file,