* Load generated trampolines into jitdump when profiling This commit updates the jitdump profiler to generate JIT profiling records for generated trampolines in a wasm module in addition to the functions already in a module. It's also updated to learn about trampolines generated via `Func::new` and friends. These trampolines were all not previously registered meaning that stack traces with these pc values would be confusing to see in the profile output. While the names aren't the best it should at least be more clear than before if a function is hot! * Fix more builds
25 lines
691 B
Rust
25 lines
691 B
Rust
use crate::{CompiledModule, ProfilingAgent};
|
|
use anyhow::{bail, Result};
|
|
|
|
/// Interface for driving the creation of jitdump files
|
|
#[derive(Debug)]
|
|
pub struct JitDumpAgent {
|
|
_private: (),
|
|
}
|
|
|
|
impl JitDumpAgent {
|
|
/// Intialize a JitDumpAgent and write out the header
|
|
pub fn new() -> Result<Self> {
|
|
if cfg!(feature = "jitdump") {
|
|
bail!("jitdump is not supported on this platform");
|
|
} else {
|
|
bail!("jitdump support disabled at compile time");
|
|
}
|
|
}
|
|
}
|
|
|
|
impl ProfilingAgent for JitDumpAgent {
|
|
fn module_load(&self, _module: &CompiledModule, _dbg_image: Option<&[u8]>) {}
|
|
fn trampoline_load(&self, _file: &object::File<'_>) {}
|
|
}
|