From af1cecbd980a5414a3e00f6ff18e730f19061c78 Mon Sep 17 00:00:00 2001 From: David Venhoff Date: Wed, 10 Sep 2025 14:52:50 +0200 Subject: [PATCH] Provide information about the runtime information recorded by QEMU --- libnyx/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnyx/src/lib.rs b/libnyx/src/lib.rs index c9f705a..fe60d13 100644 --- a/libnyx/src/lib.rs +++ b/libnyx/src/lib.rs @@ -24,6 +24,7 @@ use fuzz_runner::nyx::aux_buffer::{NYX_SUCCESS, NYX_CRASH, NYX_TIMEOUT, NYX_INPU use libc::fcntl; use std::fmt; +use std::time::Duration; pub mod ffi; @@ -356,6 +357,11 @@ impl NyxProcess { let len = self.process.aux_buffer().misc.len; String::from_utf8_lossy(&self.process.aux_buffer().misc_data_slice()[0..len as usize]).to_string() } + + pub fn aux_result_duration(&self) -> Duration { + let result = &*self.process.aux_buffer().result; + Duration::new(result.runtime_sec.into(), result.runtime_usec * 1000) + } pub fn exec(&mut self) -> NyxReturnValue { match self.process.send_payload(){