Merge wasmtime-jit and wasmtime-profiling (#3247)
* Merge `wasmtime-jit` and `wasmtime-profiling` This commit merges the `wasmtime-profiling` crate into the `wasmtime-jit` crate. It wasn't really buying a ton being a separate crate and an upcoming refactoring I'd like to do is to remove the `FinishedFunctions` structure. To enable the profilers to work as they used to this commit changes them to pass `CompiledModule` as the argument, but this only works if the profiling trait can see the `CompiledModule` type. * Fix a length calculation
This commit is contained in:
23
crates/jit/src/profiling/vtune_disabled.rs
Normal file
23
crates/jit/src/profiling/vtune_disabled.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
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]>) {}
|
||||
}
|
||||
Reference in New Issue
Block a user