From 3238ad2ef04ddf2ca860d512ca964fe238703f6c Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Tue, 20 Dec 2022 16:51:48 +0800 Subject: [PATCH] Fix RTIO exception messages Signed-off-by: Egor Savkin --- src/runtime/src/kernel/dma.rs | 2 +- src/runtime/src/rtio_acp.rs | 2 +- src/runtime/src/rtio_csr.rs | 2 +- src/runtime/src/rtio_mgt.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/src/kernel/dma.rs b/src/runtime/src/kernel/dma.rs index e39ac23..77bfaed 100644 --- a/src/runtime/src/kernel/dma.rs +++ b/src/runtime/src/kernel/dma.rs @@ -199,7 +199,7 @@ pub extern fn dma_playback(timestamp: i64, ptr: i32) { csr::rtio_dma::error_write(1); if error & 1 != 0 { artiq_raise!("RTIOUnderflow", - format!("RTIO underflow at channel {}:{}, {{0}} mu", channel, resolve_channel_name(channel as u32)), + format!("RTIO underflow at {{0}} mu, channel {}:{}", channel, resolve_channel_name(channel as u32)), timestamp as i64, channel as i64, 0); } if error & 2 != 0 { diff --git a/src/runtime/src/rtio_acp.rs b/src/runtime/src/rtio_acp.rs index 2fff41d..5ac0bbb 100644 --- a/src/runtime/src/rtio_acp.rs +++ b/src/runtime/src/rtio_acp.rs @@ -88,7 +88,7 @@ unsafe fn process_exceptional_status(channel: i32, status: i32) { } if status & RTIO_O_STATUS_UNDERFLOW != 0 { artiq_raise!("RTIOUnderflow", - format!("RTIO underflow at channel {}:{}, {{1}} mu, slack {{2}} mu", channel, resolve_channel_name(channel as u32)), + format!("RTIO underflow at {{1}} mu, channel {}:{}, slack {{2}} mu", channel, resolve_channel_name(channel as u32)), channel as i64, timestamp, timestamp - get_counter()); } if status & RTIO_O_STATUS_DESTINATION_UNREACHABLE != 0 { diff --git a/src/runtime/src/rtio_csr.rs b/src/runtime/src/rtio_csr.rs index df30106..1fce04f 100644 --- a/src/runtime/src/rtio_csr.rs +++ b/src/runtime/src/rtio_csr.rs @@ -73,7 +73,7 @@ unsafe fn process_exceptional_status(channel: i32, status: u8) { } if status & RTIO_O_STATUS_UNDERFLOW != 0 { artiq_raise!("RTIOUnderflow", - format!("RTIO underflow at channel {}:{}, {{1}} mu, slack {{2}} mu", channel, resolve_channel_name(channel as u32)), + format!("RTIO underflow at {{1}} mu, channel {}:{}, slack {{2}} mu", channel, resolve_channel_name(channel as u32)), channel as i64, timestamp, timestamp - get_counter()); } if status & RTIO_O_STATUS_DESTINATION_UNREACHABLE != 0 { diff --git a/src/runtime/src/rtio_mgt.rs b/src/runtime/src/rtio_mgt.rs index beea59e..3de236f 100644 --- a/src/runtime/src/rtio_mgt.rs +++ b/src/runtime/src/rtio_mgt.rs @@ -348,7 +348,7 @@ fn read_device_map(cfg: &Config) -> BTreeMap { let channel = bytes_cr.read_u32().unwrap(); let device_name = bytes_cr.read_string().unwrap(); if let Some(old_entry) = device_map.insert(channel, device_name.clone()) { - error!("conflicting entries for channel {}: `{}` and `{}`", + error!("read_device_map: conflicting entries for channel {}: `{}` and `{}`", channel, old_entry, device_name); } }