Skip to content

Commit

Permalink
[SuperPMI] Added a new optional -compile argument (#62217)
Browse files Browse the repository at this point in the history
* 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 <brucefo@microsoft.com>

* Added another form of -compile argument like -c

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
  • Loading branch information
SeanWoo and BruceForstall authored Dec 1, 2021
1 parent 4f244b3 commit c370c2d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@
more than `limit` failures.
"""

compile_help = """\
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.
"""

# Start of parser object creation.

parser = argparse.ArgumentParser(description=description)
Expand Down Expand Up @@ -297,6 +301,7 @@
replay_common_parser.add_argument("--force_download", action="store_true", help=force_download_help)
replay_common_parser.add_argument("-jit_ee_version", help=jit_ee_version_help)
replay_common_parser.add_argument("-private_store", action="append", help=private_store_help)
replay_common_parser.add_argument("-compile", "-c", help=compile_help)

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

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

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

if self.coreclr_args.compile:
common_flags += [ "-c", self.coreclr_args.compile ]

if self.coreclr_args.spmi_log_file is not None:
common_flags += [ "-w", self.coreclr_args.spmi_log_file ]

Expand Down Expand Up @@ -1452,7 +1460,7 @@ def replay_with_asm_diffs(self):
flags += base_option_flags
flags += diff_option_flags

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

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

if self.coreclr_args.compile:
flags += [ "-c", self.coreclr_args.compile ]

if self.coreclr_args.spmi_log_file is not None:
flags += [ "-w", self.coreclr_args.spmi_log_file ]

Expand Down Expand Up @@ -2970,6 +2981,11 @@ def verify_replay_common_args():
lambda unused: True,
"Unable to set mch_files")

coreclr_args.verify(args,
"compile",
lambda unused: True,
"Method context not valid")

coreclr_args.verify(args,
"private_store",
lambda item: True,
Expand Down

0 comments on commit c370c2d

Please sign in to comment.