From b64c75fd71af13c80f133d653bc847a199b326fe Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 1 Feb 2024 11:27:41 +0800 Subject: [PATCH] subkernel: warn on kernel finish w/ pending msgs --- artiq/firmware/satman/kernel.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/satman/kernel.rs b/artiq/firmware/satman/kernel.rs index 755b80d16..250f6a263 100644 --- a/artiq/firmware/satman/kernel.rs +++ b/artiq/firmware/satman/kernel.rs @@ -267,6 +267,14 @@ impl MessageManager { } None } + + pub fn pending_ids(&self) -> Vec { + let mut pending_ids: Vec = Vec::new(); + for msg in self.in_queue.iter() { + pending_ids.push(msg.id); + } + pending_ids + } } impl Session { @@ -487,7 +495,6 @@ impl Manager { self.stop(); self.runtime_exception(Error::DmaError(DmaError::UploadFail)); } - } } @@ -501,6 +508,10 @@ impl Manager { if let Some(subkernel_finished) = self.last_finished.take() { info!("subkernel {} finished, with exception: {}", subkernel_finished.id, subkernel_finished.with_exception); + let pending = self.session.messages.pending_ids(); + if pending.len() > 0 { + warn!("subkernel terminated with messages still pending: {:?}", pending); + } router.route(drtioaux::Packet::SubkernelFinished { destination: subkernel_finished.source, id: subkernel_finished.id, with_exception: subkernel_finished.with_exception, exception_src: subkernel_finished.exception_source