From ed9cc36a6c35f25111539a350485db184b62e5c6 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 19 Dec 2025 20:30:31 -0500 Subject: [Rust] More session scoped logs Assign the `session_id` span field before calling into the relocation handler so logs get scoped to the specific view. --- rust/src/function_recognizer.rs | 2 ++ rust/src/relocation.rs | 2 ++ 2 files changed, 4 insertions(+) (limited to 'rust/src') diff --git a/rust/src/function_recognizer.rs b/rust/src/function_recognizer.rs index 0d85d827..f46c741d 100644 --- a/rust/src/function_recognizer.rs +++ b/rust/src/function_recognizer.rs @@ -50,6 +50,7 @@ where let bv = unsafe { BinaryView::from_raw(bv).to_owned() }; let func = unsafe { Function::from_raw(func).to_owned() }; let llil = unsafe { LowLevelILFunction::from_raw(llil).to_owned() }; + let _span = ffi_span!("FunctionRecognizer::recognize_low_level_il", bv); context.recognizer.recognize_low_level_il(&bv, &func, &llil) } @@ -66,6 +67,7 @@ where let bv = unsafe { BinaryView::from_raw(bv).to_owned() }; let func = unsafe { Function::from_raw(func).to_owned() }; let mlil = unsafe { MediumLevelILFunction::from_raw(mlil).to_owned() }; + let _span = ffi_span!("FunctionRecognizer::recognize_medium_level_il", bv); context .recognizer .recognize_medium_level_il(&bv, &func, &mlil) diff --git a/rust/src/relocation.rs b/rust/src/relocation.rs index a4f9667e..a2c38221 100644 --- a/rust/src/relocation.rs +++ b/rust/src/relocation.rs @@ -442,6 +442,7 @@ where .iter() .map(RelocationInfo::from_raw) .collect::>(); + let _span = ffi_span!("RelocationHandler::get_relocation_info", bv); let ok = custom_handler.get_relocation_info(bv.as_ref(), arch.as_ref(), info.as_mut_slice()); for (result, info) in result.iter_mut().zip(info.iter()) { @@ -466,6 +467,7 @@ where let arch = unsafe { CoreArchitecture::from_raw(arch) }; let reloc = unsafe { Relocation::from_raw(reloc) }; let dest = unsafe { core::slice::from_raw_parts_mut(dest, len) }; + let _span = ffi_span!("RelocationHandler::apply_relocation", bv); custom_handler.apply_relocation(bv.as_ref(), arch.as_ref(), &reloc, dest) } -- cgit v1.3.1