From 395c64a30f37a1bfae07c4aff5a4daa7c5d4d3cb Mon Sep 17 00:00:00 2001 From: rezado <1908819406@qq.com> Date: Wed, 3 Jun 2026 15:34:00 +0800 Subject: [PATCH] Align SPEC2006 xalancbmk workload arguments --- workloads/linux/spec2006/spec06.json | 6 +++++- workloads/linux/spec2006/spec2006-package.py | 18 ++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/workloads/linux/spec2006/spec06.json b/workloads/linux/spec2006/spec06.json index 1faa7c0..e8916d7 100644 --- a/workloads/linux/spec2006/spec06.json +++ b/workloads/linux/spec2006/spec06.json @@ -827,7 +827,11 @@ "args": [ "-v", "t5.xml", - "xalanc.xsl" + "xalanc.xsl", + ">", + "out.log", + "2>", + "err.log" ], "type": [ "int", diff --git a/workloads/linux/spec2006/spec2006-package.py b/workloads/linux/spec2006/spec2006-package.py index 7f817dd..c15d7d3 100644 --- a/workloads/linux/spec2006/spec2006-package.py +++ b/workloads/linux/spec2006/spec2006-package.py @@ -310,24 +310,22 @@ def apply_benchmark_post_setup(bench_dir, spec_root, elf, spec_cfg): def shell_command(binary_name, args): before_redirect = [] - stdin_file = None + redirects = [] iterator = iter(args) for arg in iterator: - if arg == "<": + if arg in ("<", ">", ">>", "2>", "2>>"): try: - stdin_file = next(iterator) + redirect_file = next(iterator) except StopIteration as exc: - raise RuntimeError("input redirection without file") from exc - rest = list(iterator) - if rest: - raise RuntimeError(f"unsupported arguments after input redirection: {rest}") - break + raise RuntimeError(f"{arg} redirection without file") from exc + redirects.append(f"{arg} {shlex.quote(redirect_file)}") + continue before_redirect.append(arg) words = ["./" + binary_name] + before_redirect cmd = " ".join(shlex.quote(x) for x in words) - if stdin_file is not None: - cmd += " < " + shlex.quote(stdin_file) + if redirects: + cmd += " " + " ".join(redirects) return cmd