Adds JIT profiling support for VTune (#819)
This patch adds initial support for ittapi which is an open
source profiling api for instrumentation and tracing and profiling
of jitted code. Result files can be read by VTune for analysis
Build:
cargo build --features=vtune
Profile: // Using amplxe-cl from VTune
amplxe-cl -v -collect hostpost target/debug/wasmtime --vtune test.wasm
This commit is contained in:
33
crates/profiling/src/vtune_disabled.rs
Normal file
33
crates/profiling/src/vtune_disabled.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use crate::ProfilingAgent;
|
||||
use anyhow::{bail, Result};
|
||||
use wasmtime_environ::entity::PrimaryMap;
|
||||
use wasmtime_environ::wasm::DefinedFuncIndex;
|
||||
use wasmtime_environ::Module;
|
||||
use wasmtime_runtime::VMFunctionBody;
|
||||
|
||||
/// Interface for driving vtune support
|
||||
#[derive(Debug)]
|
||||
pub struct VTuneAgent {
|
||||
_private: (),
|
||||
}
|
||||
|
||||
impl VTuneAgent {
|
||||
/// Intialize a VTuneAgent and write out the header
|
||||
pub fn new() -> Result<Self> {
|
||||
if cfg!(feature = "vtune") {
|
||||
bail!("VTune is not supported on this platform.");
|
||||
} else {
|
||||
bail!("VTune support disabled at compile time.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ProfilingAgent for VTuneAgent {
|
||||
fn module_load(
|
||||
&self,
|
||||
_module: &Module,
|
||||
_functions: &PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>,
|
||||
_dbg_image: Option<&[u8]>,
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user