Load generated trampolines into jitdump when profiling (#3344)
* 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
This commit is contained in:
@@ -500,7 +500,9 @@ impl Module {
|
||||
let signatures = Arc::new(SignatureCollection::new_for_module(
|
||||
engine.signatures(),
|
||||
&types.wasm_signatures,
|
||||
modules.iter().flat_map(|m| m.trampolines()),
|
||||
modules
|
||||
.iter()
|
||||
.flat_map(|m| m.trampolines().map(|(idx, f, _)| (idx, f))),
|
||||
));
|
||||
|
||||
let module = modules.remove(main_module);
|
||||
|
||||
@@ -86,6 +86,7 @@ where
|
||||
// also take care of unwind table registration.
|
||||
let mut code_memory = CodeMemory::new(obj);
|
||||
let code = code_memory.publish()?;
|
||||
engine.config().profiler.trampoline_load(&code.obj);
|
||||
|
||||
// Extract the host/wasm trampolines from the results of compilation since
|
||||
// we know their start/length.
|
||||
|
||||
Reference in New Issue
Block a user