Skip to content

Commit c370c2d

Browse files
[SuperPMI] Added a new optional -compile argument (#62217)
* Added a new optional -compile argument that specifies which method contexts need to be compiled * Update src/coreclr/scripts/superpmi.py Co-authored-by: Bruce Forstall <[email protected]> * Added another form of -compile argument like -c Co-authored-by: Bruce Forstall <[email protected]>
1 parent 4f244b3 commit c370c2d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/coreclr/scripts/superpmi.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@
210210
more than `limit` failures.
211211
"""
212212

213+
compile_help = """\
214+
Compile only specified method contexts, e.g., `-compile 20,25`. This is passed directly to the superpmi.exe `-compile` argument. See `superpmi.exe -?` for full documentation about allowed formats.
215+
"""
216+
213217
# Start of parser object creation.
214218

215219
parser = argparse.ArgumentParser(description=description)
@@ -297,6 +301,7 @@
297301
replay_common_parser.add_argument("--force_download", action="store_true", help=force_download_help)
298302
replay_common_parser.add_argument("-jit_ee_version", help=jit_ee_version_help)
299303
replay_common_parser.add_argument("-private_store", action="append", help=private_store_help)
304+
replay_common_parser.add_argument("-compile", "-c", help=compile_help)
300305

301306
# subparser for replay
302307
replay_parser = subparsers.add_parser("replay", description=replay_description, parents=[core_root_parser, target_parser, superpmi_common_parser, replay_common_parser])
@@ -1212,7 +1217,7 @@ def replay(self):
12121217
if self.coreclr_args.arch != self.coreclr_args.target_arch:
12131218
repro_flags += [ "-target", self.coreclr_args.target_arch ]
12141219

1215-
if not self.coreclr_args.sequential:
1220+
if not self.coreclr_args.sequential and not self.coreclr_args.compile:
12161221
common_flags += [ "-p" ]
12171222

12181223
if self.coreclr_args.break_on_assert:
@@ -1221,6 +1226,9 @@ def replay(self):
12211226
if self.coreclr_args.break_on_error:
12221227
common_flags += [ "-boe" ]
12231228

1229+
if self.coreclr_args.compile:
1230+
common_flags += [ "-c", self.coreclr_args.compile ]
1231+
12241232
if self.coreclr_args.spmi_log_file is not None:
12251233
common_flags += [ "-w", self.coreclr_args.spmi_log_file ]
12261234

@@ -1452,7 +1460,7 @@ def replay_with_asm_diffs(self):
14521460
flags += base_option_flags
14531461
flags += diff_option_flags
14541462

1455-
if not self.coreclr_args.sequential:
1463+
if not self.coreclr_args.sequential and not self.coreclr_args.compile:
14561464
flags += [ "-p" ]
14571465

14581466
if self.coreclr_args.break_on_assert:
@@ -1461,6 +1469,9 @@ def replay_with_asm_diffs(self):
14611469
if self.coreclr_args.break_on_error:
14621470
flags += [ "-boe" ]
14631471

1472+
if self.coreclr_args.compile:
1473+
flags += [ "-c", self.coreclr_args.compile ]
1474+
14641475
if self.coreclr_args.spmi_log_file is not None:
14651476
flags += [ "-w", self.coreclr_args.spmi_log_file ]
14661477

@@ -2970,6 +2981,11 @@ def verify_replay_common_args():
29702981
lambda unused: True,
29712982
"Unable to set mch_files")
29722983

2984+
coreclr_args.verify(args,
2985+
"compile",
2986+
lambda unused: True,
2987+
"Method context not valid")
2988+
29732989
coreclr_args.verify(args,
29742990
"private_store",
29752991
lambda item: True,

0 commit comments

Comments
 (0)