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)
| 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 | |
| 264 | fn module_symbols(name: String, module: &Module) -> Option<LibraryInfo> { |
no test coverage detected