diff --git a/runtest.py b/runtest.py index 07a18a2059c6ab4406757dfbe3fdb89b2f2a5f9e..530497cf1c7817b5ea06ef83c5b1508230fe975f 100644 --- a/runtest.py +++ b/runtest.py @@ -20,6 +20,8 @@ parser.add_argument("-m", "--mem", nargs="?", const="8G", help="Maximum amount of memory used. Should be written as <number><unit> where <unit> may be nothing, K, M or G, e.g. 100M") parser.add_argument("-n", "--norun", action='store_true', default=False, help="To only generate script and command") +parser.add_argument("-c", "--core", nargs="?", const="1", + help="Core on which the job should be ran") args = parser.parse_args() pkg_path = Path(args.pkg) @@ -131,7 +133,7 @@ if not args.norun: print("Running script...") cmd = ["systemd-run", "--scope", "--user", "-p", f"MemoryMax={memory_b}", "-p", "MemorySwapMax=0"]*( - memory_b != None) + ["perf", "stat", "-o", "perflog.txt"]*args.perf + ["taskset", "1", "./command.sh"] + memory_b != None) + ["perf", "stat", "-o", "perflog.txt"]*args.perf + ["taskset", args.core, "./command.sh"] p = subprocess.Popen(cmd, start_new_session=True, stdout=out_file, stderr=log_file)