@@ -51,6 +51,7 @@ use hyperlight_guest_bin::host_comm::{
5151use hyperlight_guest_bin:: memory:: malloc;
5252use hyperlight_guest_bin:: { MIN_STACK_ADDRESS , guest_logger} ;
5353use log:: { LevelFilter , error} ;
54+ use tracing:: { Span , instrument} ;
5455
5556extern crate hyperlight_guest;
5657
@@ -89,6 +90,7 @@ fn echo_float(function_call: &FunctionCall) -> Result<Vec<u8>> {
8990 }
9091}
9192
93+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
9294fn print_output ( message : & str ) -> Result < Vec < u8 > > {
9395 let res = call_host_function :: < i32 > (
9496 "HostPrint" ,
@@ -99,6 +101,7 @@ fn print_output(message: &str) -> Result<Vec<u8>> {
99101 Ok ( get_flatbuffer_result ( res) )
100102}
101103
104+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
102105fn simple_print_output ( function_call : & FunctionCall ) -> Result < Vec < u8 > > {
103106 if let ParameterValue :: String ( message) = function_call. parameters . clone ( ) . unwrap ( ) [ 0 ] . clone ( ) {
104107 print_output ( & message)
@@ -865,6 +868,7 @@ fn exec_mapped_buffer(function_call: &FunctionCall) -> Result<Vec<u8>> {
865868}
866869
867870#[ no_mangle]
871+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
868872pub extern "C" fn hyperlight_main ( ) {
869873 let twenty_four_k_in_def = GuestFunctionDefinition :: new (
870874 "24K_in_8K_out" . to_string ( ) ,
@@ -1321,6 +1325,7 @@ pub extern "C" fn hyperlight_main() {
13211325}
13221326
13231327#[ no_mangle]
1328+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
13241329pub fn guest_dispatch_function ( function_call : FunctionCall ) -> Result < Vec < u8 > > {
13251330 // This test checks the stack behavior of the input/output buffer
13261331 // by calling the host before serializing the function call.
@@ -1366,6 +1371,7 @@ pub fn guest_dispatch_function(function_call: FunctionCall) -> Result<Vec<u8>> {
13661371}
13671372
13681373// Interprets the given guest function call as a host function call and dispatches it to the host.
1374+ #[ instrument( skip_all, parent = Span :: current( ) , level= "Trace" ) ]
13691375fn fuzz_host_function ( func : FunctionCall ) -> Result < Vec < u8 > > {
13701376 let mut params = func. parameters . unwrap ( ) ;
13711377 // first parameter must be string (the name of the host function to call)
0 commit comments