Skip to content

Commit f0f22e6

Browse files
committed
[trace-host] remove unused OutBAction::TraceRecordStack
- The guest side does not use this type of OutBAction - The stack unwinding is done either way when the mem_profile feature is enabled Signed-off-by: Doru Blânzeanu <[email protected]>
1 parent cdacc08 commit f0f22e6

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/hyperlight_common/src/outb.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ impl TryFrom<u8> for Exception {
9090
/// - CallFunction: makes a call to a host function,
9191
/// - Abort: aborts the execution of the guest,
9292
/// - DebugPrint: prints a message to the host
93-
/// - TraceRecordStack: records the stack trace of the guest
9493
/// - TraceMemoryAlloc: records memory allocation events
9594
/// - TraceMemoryFree: records memory deallocation events
9695
/// - TraceRecord: records a trace event in the guest
@@ -99,14 +98,12 @@ pub enum OutBAction {
9998
CallFunction = 101,
10099
Abort = 102,
101100
DebugPrint = 103,
102-
#[cfg(feature = "mem_profile")]
103-
TraceRecordStack = 104,
101+
#[cfg(feature = "trace_guest")]
102+
TraceRecord = 104,
104103
#[cfg(feature = "mem_profile")]
105104
TraceMemoryAlloc = 105,
106105
#[cfg(feature = "mem_profile")]
107106
TraceMemoryFree = 106,
108-
#[cfg(feature = "trace_guest")]
109-
TraceRecord = 107,
110107
}
111108

112109
impl TryFrom<u16> for OutBAction {
@@ -117,14 +114,12 @@ impl TryFrom<u16> for OutBAction {
117114
101 => Ok(OutBAction::CallFunction),
118115
102 => Ok(OutBAction::Abort),
119116
103 => Ok(OutBAction::DebugPrint),
120-
#[cfg(feature = "mem_profile")]
121-
104 => Ok(OutBAction::TraceRecordStack),
117+
#[cfg(feature = "trace_guest")]
118+
104 => Ok(OutBAction::TraceRecord),
122119
#[cfg(feature = "mem_profile")]
123120
105 => Ok(OutBAction::TraceMemoryAlloc),
124121
#[cfg(feature = "mem_profile")]
125122
106 => Ok(OutBAction::TraceMemoryFree),
126-
#[cfg(feature = "trace_guest")]
127-
107 => Ok(OutBAction::TraceRecord),
128123
_ => Err(anyhow::anyhow!("Invalid OutBAction value: {}", val)),
129124
}
130125
}

src/hyperlight_host/src/sandbox/outb.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,6 @@ pub(crate) fn handle_outb(
302302
Ok(())
303303
}
304304
#[cfg(feature = "mem_profile")]
305-
OutBAction::TraceRecordStack => {
306-
let Ok(stack) = unwind(_hv, mem_mgr, _hv.trace_info_as_ref()) else {
307-
return Ok(());
308-
};
309-
record_trace_frame(_hv.trace_info_as_ref(), 1u64, |f| {
310-
write_stack(f, &stack);
311-
})
312-
}
313-
#[cfg(feature = "mem_profile")]
314305
OutBAction::TraceMemoryAlloc => {
315306
use crate::hypervisor::regs::CommonRegisters;
316307

0 commit comments

Comments
 (0)