From 9897e5870794a0bf4fd175bb5fb13c0e62c9e005 Mon Sep 17 00:00:00 2001 From: Anisse Astier Date: Fri, 29 Nov 2024 09:35:52 +0100 Subject: [PATCH] hwbench: add option --no-tuning to disable tuning for some runs --- hwbench/hwbench.py | 8 +++++++- hwbench/tuning/setup.py | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hwbench/hwbench.py b/hwbench/hwbench.py index b53d290..d22943d 100755 --- a/hwbench/hwbench.py +++ b/hwbench/hwbench.py @@ -36,7 +36,7 @@ def main(): # configure logging init_logging(tuning_out_dir / "hwbench-tuning.log") - tuning_setup.Tuning(tuning_out_dir).apply() + tuning_setup.Tuning(tuning_out_dir).apply(args.tuning) env = env_soft.Environment(out_dir) hw = env_hw.Hardware(out_dir, args.monitoring_config) @@ -91,6 +91,12 @@ def parse_options(): "--output-directory", help="Specify the directory used to put all results and collected information", ) + parser.add_argument( + "--tuning", + action=argparse.BooleanOptionalAction, + default=True, + help="Enable or disable tuning: this is useful when you want to test the system as-is.", + ) return parser.parse_args() diff --git a/hwbench/tuning/setup.py b/hwbench/tuning/setup.py index 71c3326..66e0c87 100644 --- a/hwbench/tuning/setup.py +++ b/hwbench/tuning/setup.py @@ -3,13 +3,17 @@ from .scheduler import MQDeadlineIOScheduler from .turbo_boost import IntelTurboBoost, TurboBoost from ..utils.external import External_Simple +from ..utils.hwlogging import tunninglog class Tuning: def __init__(self, out_dir): self.out_dir = out_dir - def apply(self): + def apply(self, apply_tuning: bool): + if not apply_tuning: + tunninglog().info("Tunning has been disabled on the hwbench command line") + return External_Simple(self.out_dir, ["sync"]) SysctlDropCaches(self.out_dir).run() PerformancePowerProfile(self.out_dir).run()