Parse `perf script -F ip,sym,symoff,dso` output to extract samples that come from a perf map (i.e. compiled WebAssembly code and trampolines).
(output: &str)
| 512 | /// Parse `perf script -F ip,sym,symoff,dso` output to extract samples that |
| 513 | /// come from a perf map (i.e. compiled WebAssembly code and trampolines). |
| 514 | fn parse_perf_script(output: &str) -> (Vec<PerfSample>, usize) { |
| 515 | let mut samples = Vec::new(); |
| 516 | let mut total_samples = 0; |
| 517 | for line in output.lines() { |
| 518 | total_samples += 1; |
| 519 | if let Some(sample) = parse_perf_script_line(line.trim()) { |
| 520 | samples.push(sample); |
| 521 | } |
| 522 | } |
| 523 | (samples, total_samples) |
| 524 | } |
| 525 | |
| 526 | fn parse_perf_script_line(line: &str) -> Option<PerfSample> { |
| 527 | // perf script -F ip,sym,symoff,dso gives lines like: |