Skip to main content

TraceOptions

Struct TraceOptions 

Source
pub struct TraceOptions {
Show 14 fields pub instruction_fetches: bool, pub physical_addresses: bool, pub ordering: Ordering, pub follow_handlers: bool, pub block_interrupts: bool, pub interrupt_pacing: Option<u64>, pub macsim: bool, pub macsim_include_faulted: bool, pub macsim_sideband: bool, pub extended: bool, pub gzip_level: u32, pub zstd_level: i32, pub max_instructions: Option<u64>, pub trap_flag_guard: bool,
}
Expand description

Everything you can switch on and off.

Fields§

§instruction_fetches: bool

Record instruction-fetch accesses in the extended trace.

§physical_addresses: bool

Translate every access to a guest-physical address.

§ordering: Ordering

How vCPUs are ordered against each other.

§follow_handlers: bool

Plant breakpoints on interrupt, exception and system-call entry points so that handlers are traced too (see crate::events). Without this, every handler runs untraced.

§block_interrupts: bool

Ask KVM not to inject interrupts while tracing (KVM_GUESTDBG_BLOCKIRQ, Linux ≥ 5.15). Interrupts are held pending, not lost: they are delivered when tracing stops, or in the windows opened by interrupt_pacing.

§interrupt_pacing: Option<u64>

With block_interrupts: every this many instructions, let pending interrupts in for PACING_WINDOW instructions. The handlers they start are traced like any other code.

Why: a traced guest runs one to two orders of magnitude slower than normal, but its timers still run on host time. Delivered as they fall due, timer interrupts arrive faster than the slowed guest can service them and an OS kernel livelocks in its interrupt handlers. Pacing bounds the interrupt rate in guest instructions.

§macsim: bool

Write MacSim .raw files.

§macsim_include_faulted: bool

Also write instructions that faulted to the MacSim stream (Pin reports them too, since it instruments before execution).

§macsim_sideband: bool

With macsim: also write the sideband trace_<vcpu>.side (crate::side): CS, CPL, CR3, physical addresses, instruction bytes and every access, one entry per MacSim record.

§extended: bool

Write extended .kvt files.

§gzip_level: u32

gzip level for MacSim files (1 = fastest).

§zstd_level: i32

zstd level for .kvt files.

§max_instructions: Option<u64>

Stop after this many instructions in total.

§trap_flag_guard: bool

After tracing stops, keep catching stale single-step traps (see KvmTracer::disable).

Trait Implementations§

Source§

impl Clone for TraceOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TraceOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TraceOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.