wasmtime_jit/profiling/
vtune_disabled.rs

1use crate::ProfilingAgent;
2use anyhow::{bail, Result};
3
4/// Interface for driving vtune support
5#[derive(Debug)]
6pub struct VTuneAgent {
7    _private: (),
8}
9
10impl VTuneAgent {
11    /// Intialize a dummy VTuneAgent that will fail upon instantiation.
12    pub fn new() -> Result<Self> {
13        if cfg!(feature = "vtune") {
14            bail!("VTune is not supported on this platform.");
15        } else {
16            bail!("VTune support disabled at compile time.");
17        }
18    }
19}
20
21impl ProfilingAgent for VTuneAgent {
22    fn module_load(&self, _module: &crate::CompiledModule, _dbg_image: Option<&[u8]>) {}
23    fn load_single_trampoline(
24        &self,
25        _name: &str,
26        _addr: *const u8,
27        _size: usize,
28        __pid: u32,
29        _tid: u32,
30    ) {
31    }
32}