Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@
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.
"""

produce_repro_help = """\
If passed, produce the *.mc repro files.
"""

# Start of parser object creation.

parser = argparse.ArgumentParser(description=description)
Expand Down Expand Up @@ -323,6 +327,7 @@ def add_core_root_arguments(parser, build_type_default, build_type_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)
replay_common_parser.add_argument("--produce_repro", action="store_true", help=produce_repro_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 @@ -1500,6 +1505,7 @@ def save_repro_mc_files(temp_location, coreclr_args, artifacts_base_name, repro_
""" For commands that use the superpmi "-r" option to create "repro" .mc files, copy these to a
location where they are saved (and not in a "temp" directory) for easy use by the user.
"""

# If there are any .mc files, drop them into artifacts/repro/<host_os>.<arch>.<build_type>/*.mc
mc_files = [os.path.join(temp_location, item) for item in os.listdir(temp_location) if item.endswith(".mc")]
if len(mc_files) > 0:
Expand Down Expand Up @@ -1643,10 +1649,14 @@ def replay(self):
repro_flags = []

common_flags = [
"-v", "ewi", # display errors, warnings, missing, jit info
"-r", os.path.join(temp_location, "repro") # Repro name prefix, create .mc repro files
"-v", "ewi" # display errors, warnings, missing, jit info
]

if self.coreclr_args.produce_repro:
common_flags += [
"-r", os.path.join(temp_location, "repro") # Repro name prefix, create .mc repro files
]

if self.coreclr_args.altjit:
repro_flags += [
"-jitoption", "force", "AltJit=*",
Expand Down Expand Up @@ -2151,8 +2161,12 @@ def replay_with_asm_diffs(self):
"-v", "ewi", # display errors, warnings, missing, jit info
"-f", fail_mcl_file, # Failing mc List
"-details", detailed_info_file, # Detailed information about each context
"-r", os.path.join(temp_location, "repro"), # Repro name prefix, create .mc repro files
]
if self.coreclr_args.produce_repro:
flags += [
"-r", os.path.join(temp_location, "repro") # Repro name prefix, create .mc repro files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to remove the -r above, or you'll be adding it twice.

]

flags += altjit_asm_diffs_flags
flags += base_option_flags
flags += diff_option_flags
Expand Down Expand Up @@ -4482,6 +4496,11 @@ def verify_replay_common_args():
lambda unused: True,
"Method context not valid")

coreclr_args.verify(args,
"produce_repro",
lambda unused: True,
"Unable to set produce_repro")

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