From f8d414ec37d731d9ce4a5c10e6945faf7c74d2e3 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 17 Aug 2025 11:39:26 -0400 Subject: [PATCH] Meta: Pass ladybird.py extra arguments to the target process Let's behave a bit more like the run command here. This allows us to run `ladybird.py profile js zlib.js`, for example. --- Meta/ladybird.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Meta/ladybird.py b/Meta/ladybird.py index 9d82c873ef8..51d2b05a738 100755 --- a/Meta/ladybird.py +++ b/Meta/ladybird.py @@ -90,7 +90,7 @@ def main(): parents=[preset_parser, compiler_parser, target_parser], ) profile_parser.add_argument( - "args", nargs=argparse.REMAINDER, help="Additional arguments passed through to the build system" + "args", nargs=argparse.REMAINDER, help="Additional arguments passed through to the application" ) install_parser = subparsers.add_parser( @@ -168,8 +168,8 @@ def main(): debug_main(platform.host_system, build_dir, args.target, args.debugger, args.cmd) elif args.command == "profile": build_dir = configure_main(platform, args.preset, args.cc, args.cxx) - build_main(build_dir, args.jobs, args.target, args.args) - profile_main(platform.host_system, build_dir, args.target) + build_main(build_dir, args.jobs, args.target) + profile_main(platform.host_system, build_dir, args.target, args.args) elif args.command == "install": build_dir = configure_main(platform, args.preset, args.cc, args.cxx) build_main(build_dir, args.jobs, args.target, args.args) @@ -400,7 +400,7 @@ def debug_main(host_system: HostSystem, build_dir: Path, target: str, debugger: run_command(gdb_args, exit_on_failure=True) -def profile_main(host_system: HostSystem, build_dir: Path, target: str): +def profile_main(host_system: HostSystem, build_dir: Path, target: str, args: list[str]): if not shutil.which("valgrind"): print("Please install valgrind", file=sys.stderr) sys.exit(1) @@ -412,6 +412,8 @@ def profile_main(host_system: HostSystem, build_dir: Path, target: str): else: valgrind_args.append(str(build_dir.joinpath("bin", target))) + valgrind_args.extend(args) + run_command(valgrind_args, exit_on_failure=True)