MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / finish

Method finish

crates/wasmtime/src/runtime/profiling.rs:252–261  ·  view source on GitHub ↗

When the guest finishes running, call this function to write the profile to the given `output`. The output is a JSON-formatted object in the [Firefox "processed profile format"][fmt]. Files in this format may be visualized at . [fmt]: https://github.com/firefox-devtools/profiler/blob/main/docs-developer/processed-profile-format.md

(mut self, output: impl std::io::Write)

Source from the content-addressed store, hash-verified

250 ///
251 /// [fmt]: https://github.com/firefox-devtools/profiler/blob/main/docs-developer/processed-profile-format.md
252 pub fn finish(mut self, output: impl std::io::Write) -> Result<()> {
253 let now = Timestamp::from_nanos_since_reference(
254 self.start.elapsed().as_nanos().try_into().unwrap(),
255 );
256 self.profile.set_thread_end_time(self.thread, now);
257 self.profile.set_process_end_time(self.process, now);
258
259 serde_json::to_writer(output, &self.profile)?;
260 Ok(())
261 }
262}
263
264fn module_symbols(name: String, module: &Module) -> Option<LibraryInfo> {

Callers 12

fmtMethod · 0.45
fmtMethod · 0.45
build_module_artifactsFunction · 0.45
link_and_append_codeMethod · 0.45
hash_for_configFunction · 0.45
fmtMethod · 0.45
finish_objectMethod · 0.45
fmtMethod · 0.45
fmtMethod · 0.45
_serializeMethod · 0.45
fmtMethod · 0.45

Calls 3

OkFunction · 0.85
unwrapMethod · 0.45
try_intoMethod · 0.45

Tested by

no test coverage detected