File tree 6 files changed +16
-3
lines changed 6 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ pub fn start_recording(
71
71
command_name,
72
72
args,
73
73
iteration_count,
74
+ ignore_exit_code,
74
75
} = process_launch_props;
75
76
76
77
if profile_creation_props. coreclr . any_enabled ( ) {
@@ -191,7 +192,7 @@ pub fn start_recording(
191
192
WaitStatus :: Exited ( _pid, exit_code) => ExitStatus :: from_raw ( * exit_code) . success ( ) ,
192
193
_ => false ,
193
194
} ;
194
- if !previous_run_exited_with_success {
195
+ if !ignore_exit_code && ! previous_run_exited_with_success {
195
196
eprintln ! (
196
197
"Skipping remaining iterations due to non-success exit status: {wait_status:?}"
197
198
) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ pub struct TaskLauncher {
28
28
args : Vec < OsString > ,
29
29
child_env : Vec < ( OsString , OsString ) > ,
30
30
iteration_count : u32 ,
31
+ ignore_exit_code : bool ,
31
32
}
32
33
33
34
impl RootTaskRunner for TaskLauncher {
@@ -41,7 +42,7 @@ impl RootTaskRunner for TaskLauncher {
41
42
let mut exit_status = root_child. wait ( ) . expect ( "couldn't wait for child" ) ;
42
43
43
44
for i in 2 ..=self . iteration_count {
44
- if !exit_status. success ( ) {
45
+ if !self . ignore_exit_code && ! exit_status. success ( ) {
45
46
eprintln ! (
46
47
"Skipping remaining iterations due to non-success exit status: \" {}\" " ,
47
48
exit_status
@@ -65,6 +66,7 @@ impl TaskLauncher {
65
66
program : S ,
66
67
args : I ,
67
68
iteration_count : u32 ,
69
+ ignore_exit_code : bool ,
68
70
env_vars : & [ ( OsString , OsString ) ] ,
69
71
extra_env_vars : & [ ( OsString , OsString ) ] ,
70
72
) -> Result < TaskLauncher , MachError >
@@ -91,6 +93,7 @@ impl TaskLauncher {
91
93
args,
92
94
child_env,
93
95
iteration_count,
96
+ ignore_exit_code,
94
97
} )
95
98
}
96
99
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ pub fn start_recording(
44
44
command_name,
45
45
args,
46
46
iteration_count,
47
+ ignore_exit_code,
47
48
} = process_launch_props;
48
49
49
50
let task_launcher = if profile_creation_props. coreclr . any_enabled ( ) {
@@ -62,6 +63,7 @@ pub fn start_recording(
62
63
& command_name,
63
64
& args,
64
65
iteration_count,
66
+ ignore_exit_code,
65
67
& env_vars,
66
68
task_accepter. extra_env_vars ( ) ,
67
69
) ?
@@ -70,6 +72,7 @@ pub fn start_recording(
70
72
& command_name,
71
73
& args,
72
74
iteration_count,
75
+ ignore_exit_code,
73
76
& env_vars,
74
77
task_accepter. extra_env_vars ( ) ,
75
78
) ?
Original file line number Diff line number Diff line change @@ -203,6 +203,10 @@ struct RecordArgs {
203
203
#[ arg( long, default_value = "1" ) ]
204
204
iteration_count : u32 ,
205
205
206
+ /// Ignore exit code and continue running when iteration_count > 0
207
+ #[ arg( short, long) ]
208
+ ignore_exit_code : bool ,
209
+
206
210
#[ command( flatten) ]
207
211
profile_creation_args : ProfileCreationArgs ,
208
212
@@ -647,6 +651,7 @@ impl RecordArgs {
647
651
command_name,
648
652
args,
649
653
iteration_count,
654
+ ignore_exit_code : self . ignore_exit_code ,
650
655
} ;
651
656
652
657
RecordingMode :: Launch ( launch_props)
Original file line number Diff line number Diff line change @@ -118,4 +118,5 @@ pub struct ProcessLaunchProps {
118
118
pub command_name : OsString ,
119
119
pub args : Vec < OsString > ,
120
120
pub iteration_count : u32 ,
121
+ pub ignore_exit_code : bool ,
121
122
}
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ pub fn start_recording(
109
109
// press Ctrl+C again, which would immediately terminate this process and not
110
110
// give us a chance to stop xperf.
111
111
let exit_status = child. wait ( ) . unwrap ( ) ;
112
- if !exit_status. success ( ) {
112
+ if !process_launch_props . ignore_exit_code && ! exit_status. success ( ) {
113
113
eprintln ! (
114
114
"Skipping remaining iterations due to non-success exit status: \" {}\" " ,
115
115
exit_status
You can’t perform that action at this time.
0 commit comments