From nobody Thu Dec 18 17:54:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611673395; cv=none; d=zohomail.com; s=zohoarc; b=MZ/jn0Tqa6irihV6IcLoZmLOvB8TaFWBwhIPyFUMcPZ3eH+MWZ5J9xWYCO49SZd2IFIMnrnsvE9NvmiJo2y+4x3fww6rsne5Y0yNbTs3NiiOtLWiTOEPIO3pMBjeQMk/ZWlE7uUK1ypudeFQzCi4LsMQ/fugYYaftPZEdZR8bog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611673395; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gsxwadrVvqdkDS0/Q4er1w0dW+tRbzcn/NKa5/xW7uo=; b=aAFzvuf/Xbr4p6L8/jWAq2ikLbQPtc4CQvJ7oqtyG27rYXUt5dRgMR6mt/Wl8bVi/2KhZOEhoszX8k9cfZ6CM7wcCucL6DSwg6HD1AQZKJbLhlTkFMhbMhHFWVd8FXR0VqI3lIzD6deUhJTBU+DHx+iTuedJOkIpfmuX/RmyP20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611673395022543.6959074902987; Tue, 26 Jan 2021 07:03:15 -0800 (PST) Received: from localhost ([::1]:39798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4Ps8-0000kG-Tv for importer@patchew.org; Tue, 26 Jan 2021 10:03:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4PEd-0001MT-Vy for qemu-devel@nongnu.org; Tue, 26 Jan 2021 09:22:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l4PEV-0006c0-Ji for qemu-devel@nongnu.org; Tue, 26 Jan 2021 09:22:23 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-2M5f1ChrOaabUn6VPxKIEQ-1; Tue, 26 Jan 2021 09:22:11 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7F9610054FF; Tue, 26 Jan 2021 14:22:10 +0000 (UTC) Received: from localhost (ovpn-114-175.ams2.redhat.com [10.36.114.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FD035D9DE; Tue, 26 Jan 2021 14:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611670934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gsxwadrVvqdkDS0/Q4er1w0dW+tRbzcn/NKa5/xW7uo=; b=XOkHCKMqqxDILw56FFy4x3ZR4Fzn0Fg3TJJAtuGQrH/g62PfG6CtwYSkKujj8+un7Mqwb6 Oq/eR+x21quyzpgjowPJTk2W3q4uOfcuPDgcp8uEtk1V3ddHPsz12BwqkA/XM50odvrPed OCp5IIsWaNg2daZuJjihVo+aTRPlcwk= X-MC-Unique: 2M5f1ChrOaabUn6VPxKIEQ-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 49/53] simplebench: add bench-backup.py Date: Tue, 26 Jan 2021 15:20:12 +0100 Message-Id: <20210126142016.806073-50-mreitz@redhat.com> In-Reply-To: <20210126142016.806073-1-mreitz@redhat.com> References: <20210126142016.806073-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.255, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Add script to benchmark new backup architecture. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210116214705.822267-24-vsementsov@virtuozzo.com> [mreitz: s/not unsupported/not supported/] Signed-off-by: Max Reitz --- scripts/simplebench/bench-backup.py | 167 ++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100755 scripts/simplebench/bench-backup.py diff --git a/scripts/simplebench/bench-backup.py b/scripts/simplebench/benc= h-backup.py new file mode 100755 index 0000000000..33a1ecfefa --- /dev/null +++ b/scripts/simplebench/bench-backup.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +# +# Bench backup block-job +# +# Copyright (c) 2020 Virtuozzo International GmbH. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import argparse +import json + +import simplebench +from results_to_text import results_to_text +from bench_block_job import bench_block_copy, drv_file, drv_nbd + + +def bench_func(env, case): + """ Handle one "cell" of benchmarking table. """ + cmd_options =3D env['cmd-options'] if 'cmd-options' in env else {} + return bench_block_copy(env['qemu-binary'], env['cmd'], + cmd_options, + case['source'], case['target']) + + +def bench(args): + test_cases =3D [] + + sources =3D {} + targets =3D {} + for d in args.dir: + label, path =3D d.split(':') # paths with colon not supported + sources[label] =3D drv_file(path + '/test-source') + targets[label] =3D drv_file(path + '/test-target') + + if args.nbd: + nbd =3D args.nbd.split(':') + host =3D nbd[0] + port =3D '10809' if len(nbd) =3D=3D 1 else nbd[1] + drv =3D drv_nbd(host, port) + sources['nbd'] =3D drv + targets['nbd'] =3D drv + + for t in args.test: + src, dst =3D t.split(':') + + test_cases.append({ + 'id': t, + 'source': sources[src], + 'target': targets[dst] + }) + + binaries =3D [] # list of (