Skip to main content

Crate kvmtrace_preload

Crate kvmtrace_preload 

Source
Expand description

libkvmtrace_preload.so: trace an unmodified QEMU (or any VMM that calls ioctl(2) through libc) by loading this library with LD_PRELOAD.

KVMTRACE_OUT=trace-dir LD_PRELOAD=libkvmtrace_preload.so qemu-system-x86_64 -accel kvm ...

The library wraps ioctl. It watches the VMM create the VM, its vCPUs and its memory slots, and it takes over KVM_RUN: while tracing, every single-step exit is handled here and the vCPU is re-entered at once, so the VMM only ever sees the exits it would have seen anyway (I/O, MMIO, shutdown, signals).

Configuration is through environment variables; see the crate README or kvmtrace::book::ch07_tracing_qemu.

Functions§

ioctl⚠
The ioctl every caller in the process gets instead of libc’s.