File tree Expand file tree Collapse file tree
src/run/runner/wall_time/perf Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,9 +53,11 @@ linux-perf-data = "0.11.0"
5353debugid = " 0.8.0"
5454memmap2 = " 0.9.5"
5555nix = { version = " 0.29.0" , features = [" fs" ] }
56- procfs = " 0.17.0"
5756futures = " 0.3.31"
5857
58+ [target .'cfg(unix)' .dependencies ]
59+ procfs = " 0.17.0"
60+
5961[dev-dependencies ]
6062temp-env = { version = " 0.3.6" , features = [" async_closure" ] }
6163insta = { version = " 1.29.0" , features = [" json" , " redactions" ] }
Original file line number Diff line number Diff line change 1+ #![ cfg_attr( not( unix) , allow( dead_code, unused_mut) ) ]
2+
13use crate :: prelude:: * ;
24use crate :: run:: runner:: helpers:: run_command_with_log_pipe:: run_command_with_log_pipe_and_callback;
35use crate :: run:: runner:: helpers:: setup:: run_with_sudo;
@@ -8,7 +10,6 @@ use fifo::{PerfFifo, RunnerFifo};
810use futures:: stream:: FuturesUnordered ;
911use metadata:: PerfMetadata ;
1012use perf_map:: ProcessSymbols ;
11- use procfs:: process:: MMPermissions ;
1213use shared:: Command as FifoCommand ;
1314use std:: collections:: HashSet ;
1415use std:: path:: PathBuf ;
@@ -200,8 +201,11 @@ impl PerfRunner {
200201 FifoCommand :: CurrentBenchmark { pid, uri } => {
201202 bench_order_by_pid. entry ( pid) . or_default ( ) . push ( uri) ;
202203
204+ #[ cfg( unix) ]
203205 if !symbols_by_pid. contains_key ( & pid) && !unwind_data_by_pid. contains_key ( & pid)
204206 {
207+ use procfs:: process:: MMPermissions ;
208+
205209 let bench_proc = procfs:: process:: Process :: new ( pid as _ )
206210 . expect ( "Failed to find benchmark process" ) ;
207211 let exe_path = bench_proc. exe ( ) . expect ( "Failed to read /proc/{pid}/exe" ) ;
You can’t perform that action at this time.
0 commit comments