1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::ProfilingAgent;
use anyhow::{bail, Result};

/// 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: &crate::CompiledModule, _dbg_image: Option<&[u8]>) {}
    fn trampoline_load(&self, _file: &object::File<'_>) {}
}