From: Vladimir Sementsov-Ogievskiy Date: Thu, 28 Jan 2021 10:28:17 +0000 (+0300) Subject: simplebench/bench-backup: add target-cache argument X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=684d18efd1a35b75a6625072c68e1b7ea70bd3a8;p=qemu.git simplebench/bench-backup: add target-cache argument Allow benchmark with different kinds of target cache. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- diff --git a/scripts/simplebench/bench-backup.py b/scripts/simplebench/bench-backup.py index 72eae85bb1..fbc85f266f 100755 --- a/scripts/simplebench/bench-backup.py +++ b/scripts/simplebench/bench-backup.py @@ -65,13 +65,26 @@ def bench(args): test_cases.append({'id': t, 'source': source, 'target': nbd_drv}) continue - fname = dirs[dst] + '/test-target' - if args.compressed: - fname += '.qcow2' - target = drv_file(fname) - if args.compressed: - target = drv_qcow2(target) - test_cases.append({'id': t, 'source': source, 'target': target}) + if args.target_cache == 'both': + target_caches = ['direct', 'cached'] + else: + target_caches = [args.target_cache] + + for c in target_caches: + o_direct = c == 'direct' + fname = dirs[dst] + '/test-target' + if args.compressed: + fname += '.qcow2' + target = drv_file(fname, o_direct=o_direct) + if args.compressed: + target = drv_qcow2(target) + + test_id = t + if args.target_cache == 'both': + test_id += f'({c})' + + test_cases.append({'id': test_id, 'source': source, + 'target': target}) binaries = [] # list of (