Files
wasmtime/crates/jit/src/profiling/vtune_disabled.rs
Benjamin Bouvier 6f4f30c840 Add support for generating perf maps for simple perf profiling (#6030)
* Add support for generating perf maps for simple perf profiling

* add missing enum entry in C code

* bugfix: use hexa when printing the code region's length too (thanks bjorn3!)

* sanitize file name + use bufwriter

* introduce --profile CLI flag for wasmtime

* Update doc and doc comments for new --profile option

* remove redundant FromStr import

* Apply review feedback: make_line receives a Write impl, report errors

* fix tests?

* better docs
2023-03-20 16:17:36 +00:00

33 lines
777 B
Rust

use crate::ProfilingAgent;
use anyhow::{bail, Result};
/// Interface for driving vtune support
#[derive(Debug)]
pub struct VTuneAgent {
_private: (),
}
impl VTuneAgent {
/// Intialize a dummy VTuneAgent that will fail upon instantiation.
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: &crate::CompiledModule, _dbg_image: Option<&[u8]>) {}
fn load_single_trampoline(
&self,
_name: &str,
_addr: *const u8,
_size: usize,
__pid: u32,
_tid: u32,
) {
}
}