diff options
| author | Christian Krinitsin <mail@krinitsin.com> | 2025-11-26 10:33:57 +0100 |
|---|---|---|
| committer | Christian Krinitsin <mail@krinitsin.com> | 2025-11-26 10:33:57 +0100 |
| commit | dd386a02dce9c8fa034de983a8cbbdf59e5a5e63 (patch) | |
| tree | f9c08dc3045fe21d8ff178937fe89fa7f59b74d6 | |
| parent | 9a6ad70d17d83f8c86deb77efd2e2aec21fe200e (diff) | |
| download | focaccia-dd386a02dce9c8fa034de983a8cbbdf59e5a5e63.tar.gz focaccia-dd386a02dce9c8fa034de983a8cbbdf59e5a5e63.zip | |
Add testing options
| -rw-r--r-- | src/focaccia/benchmark/_benchmark.py | 14 | ||||
| -rwxr-xr-x | src/focaccia/tools/benchmark_focaccia.py | 25 |
2 files changed, 30 insertions, 9 deletions
diff --git a/src/focaccia/benchmark/_benchmark.py b/src/focaccia/benchmark/_benchmark.py index 46e67d0..c6059cd 100644 --- a/src/focaccia/benchmark/_benchmark.py +++ b/src/focaccia/benchmark/_benchmark.py @@ -9,9 +9,7 @@ import gdb import subprocess import time -def main(): - args = make_argparser().parse_args() - +def runtime(): detlog = DeterministicLog(args.deterministic_log) if args.deterministic_log and detlog.base_directory is None: raise NotImplementedError(f'Deterministic log {args.deterministic_log} specified but ' @@ -31,6 +29,10 @@ def main(): gdb_server = _qemu_tool.GDBServerStateIterator(f"localhost:{args.port}", detlog) gdb.execute("si") gdb.execute("continue") + try: + gdb.execute("continue") + except: + pass qemu_process.wait() timer.pause() timer.log_time() @@ -98,5 +100,11 @@ def main(): except Exception as e: raise Exception('Error occured when comparing with symbolic equations: {e}') +def main(): + args = make_argparser().parse_args() + + if args.runtime: + runtime() + if __name__ == "__main__": main() diff --git a/src/focaccia/tools/benchmark_focaccia.py b/src/focaccia/tools/benchmark_focaccia.py index ad4ce02..6b184b5 100755 --- a/src/focaccia/tools/benchmark_focaccia.py +++ b/src/focaccia/tools/benchmark_focaccia.py @@ -34,6 +34,12 @@ def make_argparser(): prog.add_argument('-n', '--iterations', default='10', help='Number of iterations per benchmark') + prog.add_argument('--runtime', + action='store_true', + help='Split runtime breakdown benchmarks') + prog.add_argument('--tracing', + action='store_true', + help='Tracing benchmarks') prog.add_argument('-l', '--deterministic-log', help='Path of the directory storing the deterministic log produced by RR') prog.add_argument('--gdb', @@ -54,12 +60,7 @@ def try_remove(l: list, v): except ValueError: pass -def main(): - argparser = make_argparser() - args = argparser.parse_args() - - logging.basicConfig(level=logging.ERROR) - +def runtime_benchmark(): # Test native tracing detlog = DeterministicLog(args.deterministic_log) if args.deterministic_log and detlog.base_directory is None: @@ -107,6 +108,18 @@ def main(): except Exception as e: raise Exception(f'Unable to benchmark QEMU: {e}') +def tracing_benchmarks(): + pass + +def main(): + argparser = make_argparser() + args = argparser.parse_args() + + logging.basicConfig(level=logging.ERROR) + + if args.runtime: + runtime_benchmark() + # Get environment env = os.environ.copy() # QEMU GDB interface |