Skip to content

Commit

Permalink
rt: add missing doc for with_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
johannst committed Feb 28, 2024
1 parent 7cc7273 commit aee9196
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ impl Runtime {
}
}

/// Create a new [Runtime] which also generates static perf metat data.
///
/// For each function added to the [Runtime], an entry will be generated in the
/// `/tmp/perf-<PID>.map` file, which `perf report` uses to symbolicate unknown addresses.
/// This is applicable for static runtimes only.
///
/// # Panics
///
/// Panics if the `mmap` call fails.
pub fn with_profile() -> Runtime {
let mut rt = Runtime::new();
rt.perf = Some(perf::PerfMap::new());
Expand Down

0 comments on commit aee9196

Please sign in to comment.