diff --git a/scheds/rust/scx_rustland/src/main.rs b/scheds/rust/scx_rustland/src/main.rs index b1e0b5a1c..b8f677915 100644 --- a/scheds/rust/scx_rustland/src/main.rs +++ b/scheds/rust/scx_rustland/src/main.rs @@ -275,15 +275,19 @@ impl<'a> Scheduler<'a> { // Called on exit to get exit code and exit message from the BPF part. fn report_bpf_exit_kind(&mut self) -> Result<()> { + // Report msg if EXT_OPS_EXIT_ERROR. match self.read_bpf_exit_kind() { 0 => Ok(()), - etype => { + etype if etype == 2 => { let cstr = unsafe { CStr::from_ptr(self.skel.bss().exit_msg.as_ptr() as *const _) }; let msg = cstr .to_str() .context("Failed to convert exit msg to string") .unwrap(); - info!("BPF exit_kind={} msg={}", etype, msg); + bail!("BPF exit_kind={} msg={}", etype, msg); + } + etype => { + info!("BPF exit_kind={}", etype); Ok(()) } }