@@ -32,6 +32,7 @@ pub type ConvertRegsNative = crate::linux_shared::ConvertRegsAarch64;
3232#[ allow( clippy:: too_many_arguments) ]
3333pub fn start_recording (
3434 output_file : & Path ,
35+ profile_name : Option < String > ,
3536 command_name : OsString ,
3637 command_args : & [ OsString ] ,
3738 time_limit : Option < Duration > ,
@@ -66,10 +67,9 @@ pub fn start_recording(
6667
6768 // Launch the observer thread. This thread will manage the perf events.
6869 let output_file_copy = output_file. to_owned ( ) ;
69- let command_name_copy = command_name. to_string_lossy ( ) . to_string ( ) ;
70+ let product = profile_name . unwrap_or_else ( || command_name. to_string_lossy ( ) . to_string ( ) ) ;
7071 let conversion_args = conversion_args. clone ( ) ;
7172 let observer_thread = thread:: spawn ( move || {
72- let product = command_name_copy;
7373 let mut converter = make_converter ( interval, & product, & conversion_args) ;
7474
7575 // Wait for the initial pid to profile.
@@ -191,6 +191,7 @@ pub fn start_recording(
191191
192192pub fn start_profiling_pid (
193193 output_file : & Path ,
194+ profile_name : Option < String > ,
194195 pid : u32 ,
195196 time_limit : Option < Duration > ,
196197 interval : Duration ,
@@ -215,7 +216,7 @@ pub fn start_profiling_pid(
215216 crossbeam_channel:: bounded ( 2 ) ;
216217
217218 let output_file_copy = output_file. to_owned ( ) ;
218- let product = format ! ( "PID {pid}" ) ;
219+ let product = profile_name . unwrap_or_else ( || format ! ( "PID {pid}" ) ) ;
219220 let conversion_args = conversion_args. clone ( ) ;
220221 let observer_thread = thread:: spawn ( {
221222 let stop = stop. clone ( ) ;
0 commit comments