From c370c2d4504a021a53883def6cd3b70e758ecb30 Mon Sep 17 00:00:00 2001 From: SeanWoo <52250045+SeanWoo@users.noreply.github.com> Date: Thu, 2 Dec 2021 00:03:46 +0400 Subject: [PATCH] [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 * Added another form of -compile argument like -c Co-authored-by: Bruce Forstall --- src/coreclr/scripts/superpmi.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py index 267879c5a9eb54..8858cee0c4dc7b 100755 --- a/src/coreclr/scripts/superpmi.py +++ b/src/coreclr/scripts/superpmi.py @@ -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) @@ -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]) @@ -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: @@ -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 ] @@ -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: @@ -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 ] @@ -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,