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 @@ -52,7 +52,7 @@ object = "0.36.7"
5252linux-perf-data = " 0.11.0"
5353debugid = " 0.8.0"
5454memmap2 = " 0.9.5"
55- nix = { version = " 0.29.0" , features = [" fs" ] }
55+ nix = { version = " 0.29.0" , features = [" fs" , " user " ] }
5656futures = " 0.3.31"
5757
5858[target .'cfg(target_os = "linux")' .dependencies ]
Original file line number Diff line number Diff line change @@ -96,13 +96,16 @@ impl PerfRunner {
9696 } ;
9797 debug ! ( "Using call graph mode: {}" , cg_mode) ;
9898
99+ let user = nix:: unistd:: User :: from_uid ( nix:: unistd:: Uid :: current ( ) ) ?. unwrap ( ) ;
99100 cmd. args ( [
100101 "-c" ,
101102 & format ! (
102- "perf record --user-callchains --freq=999 --switch-output --control=fifo:{},{} --delay=-1 -g --call-graph={cg_mode} --output={} -- {bench_cmd}" ,
103+ "perf record --user-callchains --freq=999 --switch-output --control=fifo:{},{} --delay=-1 -g --call-graph={cg_mode} --output={} -- \
104+ sudo systemd-run --scope --slice=codspeed.slice --same-dir -- runuser -u {} -- {bench_cmd}",
103105 perf_fifo. ctl_fifo_path. to_string_lossy( ) ,
104106 perf_fifo. ack_fifo_path. to_string_lossy( ) ,
105- perf_file. path( ) . to_string_lossy( )
107+ perf_file. path( ) . to_string_lossy( ) ,
108+ user. name
106109 ) ,
107110 ] ) ;
108111 debug ! ( "cmd: {:?}" , cmd) ;
You can’t perform that action at this time.
0 commit comments