Skip to main content

VcpuTracer

Struct VcpuTracer 

Source
pub struct VcpuTracer { /* private fields */ }
Expand description

The tracer for one vCPU.

Implementations§

Source§

impl VcpuTracer

Source

pub fn id(&self) -> u32

The vCPU id.

Source

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).

Source

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?

Source

pub fn finish(&mut self) -> Result<()>

Drops the pending (not yet executed) step, puts back a lifted breakpoint, and flushes the output files.

Source

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.

Source

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.

Source

pub fn pause(&mut self)

Forgets the pending step without writing it (used when tracing is switched off in the middle of a run).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.