Skip to main content

Crate wasmtime_guest_pprof

Crate wasmtime_guest_pprof 

Source
Expand description

Drive wasmtime’s GuestProfiler for you and emit gzip’d pprof directly. Spares callers from the epoch-tick / take-and-restore plumbing and the JSON-intermediate step.

§Quick start

See runners/wasmtime-runner/src/main.rs in this repo for a worked example; the key types are ProfileSession, ProfilerHost, and TakeProfileSession.

Structs§

EpochTicker
Background thread that bumps wasmtime’s epoch counter on a fixed cadence so the deadline callback fires. RAII — drop to stop.
ProfileSession
Owned wrapper around wasmtime’s GuestProfiler.

Traits§

ProfilerHost
Implemented by your Store<T> data so the crate can find the ProfileSession in the deadline callback.
ProfilerHostExt
Methods auto-applied to any type that implements ProfilerHost.
TakeProfileSession
Companion trait for stores whose data owns the session — needed to extract the session out of a consumed Store.

Functions§

json_to_pprof
Convert Firefox Profiler JSON bytes into gzip’d pprof.