pub struct VcpuTracer { /* private fields */ }Expand description
The tracer for one vCPU.
Implementations§
Source§impl VcpuTracer
impl VcpuTracer
Sourcepub fn on_stop(
&mut self,
state: &CpuState,
reason: StopReason,
ctx: &mut dyn StopContext,
unserialized: bool,
) -> Result<StopAction>
pub fn on_stop( &mut self, state: &CpuState, reason: StopReason, ctx: &mut dyn StopContext, unserialized: bool, ) -> Result<StopAction>
Handles one stop of the vCPU.
state is the vCPU’s state now. unserialized says the step that
just ended ran without the global token (see Ordering).
Sourcepub fn pending_may_block(&self) -> bool
pub fn pending_may_block(&self) -> bool
Did the last traced instruction (HLT, MWAIT) put the vCPU to sleep,
so that the next KVM_RUN may block until an interrupt arrives?
Sourcepub fn finish(&mut self) -> Result<()>
pub fn finish(&mut self) -> Result<()>
Drops the pending (not yet executed) step, puts back a lifted breakpoint, and flushes the output files.
Sourcepub fn flush(&mut self, state: &CpuState) -> Result<()>
pub fn flush(&mut self, state: &CpuState) -> Result<()>
Records the last instruction now, from state, because no further
stop is coming: the vCPU halted for good, or tracing is about to be
switched off.
A step is normally written when the next stop arrives, since only
then is its outcome known. If state.rip has moved past the pending
instruction (HLT, and port I/O that KVM completed before exiting,
both do this), the instruction retired and is written. If not, it
has not executed and is dropped.
Sourcepub fn has_lifted_breakpoint(&self) -> bool
pub fn has_lifted_breakpoint(&self) -> bool
Is one of the session’s entry breakpoints lifted (its original byte back in place) for this vCPU’s next step?
While it is, another vCPU entering the same handler would not stop there, and since event delivery clears TF its handler would run untraced. In serialized mode the vCPU therefore keeps the token until the breakpoint is back.