From patchwork Fri May 19 17:04:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 683913 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1053225wrt; Fri, 19 May 2023 10:07:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/iIM+gIflR9fDajjbe8Tmub7NFUpQvXu4+Y4l72/Y40kQjeSXSwXdtGvPPMak5GMnYBe6 X-Received: by 2002:a1f:3f03:0:b0:440:3793:6ab2 with SMTP id m3-20020a1f3f03000000b0044037936ab2mr1112406vka.13.1684516045410; Fri, 19 May 2023 10:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684516045; cv=none; d=google.com; s=arc-20160816; b=O09hCyzOj0QejSDD6U7mDv8dkiu+Qji33FEQvUp1+y58Jf+gjIgAslIsn1fcQyuOOq luHj0iSR4CgLD+aePQWJm1A+Et5aLUAuV2cYTGPlXGmAp9AduAjD+ywfRSRuCKkmdJey qDTphQaCIDJH0m7Bl1uSwaml6hcQLJst8G/6cur4Rg4c6iQkMj6Ltd3VJsyiiB6CHY0o UdB4jI//pN/hK779yAv1/J8zQcEy+3vbmhpRpTin8RXA/BjrCxLNB06mObDKKeHsajeY ovE/1tB6+On2QWUJVGU9wCkMsHDijOaxT4xcKvU995MKgCu7FotoLcH304Wc9X/A5lwo N2rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=ldIYpO58WlQz7SONVRBaMprlSjZba7awGHquy9aweoU=; b=yYugjzJIpuOI5C9QV/zkLaMq2NIxZ8oinM8cbxQuPR/5331zroVYvdRjyPzs4CfPqu p5lmfiLmilXw59nbwn6b6FObBFFvGp3XPooJEbqvsWnOiCD4GFXkR13R5TSGVMQw/gL8 +QAMRBJuHyT+YLeI+X/H6n9JWJnpUJTNXSHADwdFg5t5rVPEcKvo2iKUNvnwJxRRHuJv kWauLfp4+Wk0r0PqgHVVzlWSH1ky6MJLPM+2Tv2Bf/MPSgrxtV3FiWs077DobXfYAm/7 VT35/1whfL+O79+VlOJKdZth8IviIVHdz4iLx3/25euFxYxvUGR0KWdpXVLJpEdappDc l+RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pY7Jtv6J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o7-20020a05620a110700b00759348adcf0si2861722qkk.194.2023.05.19.10.07.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 May 2023 10:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pY7Jtv6J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q03Xe-0002Ii-LK; Fri, 19 May 2023 13:05:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q03XN-0002B3-EX for qemu-devel@nongnu.org; Fri, 19 May 2023 13:05:05 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q03XG-0005Tt-Hh for qemu-devel@nongnu.org; Fri, 19 May 2023 13:05:05 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3093a6311dcso3456743f8f.1 for ; Fri, 19 May 2023 10:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684515896; x=1687107896; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ldIYpO58WlQz7SONVRBaMprlSjZba7awGHquy9aweoU=; b=pY7Jtv6JxOqzJuC1kPWFmJfl8VDXGiwFTUq9cU7IWQsG7RgWhaCqu0d8je61zSPxRL niR/ibE1qldY8AIi6PLQNXi/1YzhIu/7QtgT8L14T2Udz0slLPyvgaDPwC+NOokv6N5m wKLdhT8t2o8rq9MPpL5GmOd7xTxd67JSETQYsKyFEPewsTxLYixOFmQqGf4noPBmYDvX pJRDMu2bxUUrbBpH4YZKw3HmBDBYWIzPpcO2OlFl42oQyJEeLQi44rj7L+hBm2i6av0G MkA0d0dkOF4W1PtHsD4raeKsC5npjDYHI8YMdAtrYMgrjPEeuo96LQ5HkZdPi2+vqaHi 4yqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684515896; x=1687107896; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ldIYpO58WlQz7SONVRBaMprlSjZba7awGHquy9aweoU=; b=k41UlImaov73v7ZGZjwlM7RWxGAR8zhALvvYAbrhuIj0C2BrLG5SS2vUuUK18Aj+ms LY0CGsA1cvPy0B2OoxYSNzUOldZ5VA1CrA02l5o/LUO6up7n8FYLbhlexpngUoafmCSQ AMmwPzTOQTTx2pvAecNhN/JYEfCuSqPWu+JTY+3RkhLNFb6k3f3o0GlWxVDz4Taw7rIS oFJiQDhSbGqproBTQor+4pkMli8eVeSaZYCb2JhB5s4ChM/OECSAEy6S5WCLiejgrETf 7zJpwokX9NukwyDYzOR5YU6uYB7hkN6ripGRnqG5jlclNBs5NtdaTj0Aekuazsx3267q bRDg== X-Gm-Message-State: AC+VfDyI2G2b2dEL7JFhwCdjnM0kgFcleiXvJqziF/JJ8/IlAdfk1hj7 yM8VQzmkrktUR5QkQLRtAAPQpA== X-Received: by 2002:a5d:5588:0:b0:304:a40c:43c6 with SMTP id i8-20020a5d5588000000b00304a40c43c6mr2057545wrv.11.1684515895655; Fri, 19 May 2023 10:04:55 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c024800b003f42ceb3bf4sm2936982wmj.32.2023.05.19.10.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 10:04:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9C6BA1FFBB; Fri, 19 May 2023 18:04:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Yanan Wang , Riku Voipio , Laurent Vivier , Marcel Apfelbaum , Marco Liebel , Mark Burton , Thomas Huth , Peter Maydell , Richard Henderson , Eduardo Habkost , Paolo Bonzini , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 0/8] plugins/next: bugfixs and iops based time control RFC Date: Fri, 19 May 2023 18:04:46 +0100 Message-Id: <20230519170454.2353945-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Hi, There are a couple of bug fixes in here but also the RFC for exposing time control to the plugin. Its very rough and ready and I've not done very many tests on the stability of the time slowing down but reducing the iops value does seem to at least get reflected in slower dhrystone scores. Alex. Alex Bennée (8): plugins: force slow path when plugins instrument memory ops plugins: fix memory leak while parsing options plugins: update lockstep to use g_memdup2 sysemu: add set_virtual_time to accel ops qtest: use cpu interface in qtest_clock_warp sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time plugins: add time control API contrib/plugins: add iops plugin example for cost modelling include/exec/cpu-all.h | 2 +- include/hw/core/cpu.h | 17 ++ include/qemu/qemu-plugin.h | 19 ++ include/qemu/timer.h | 15 + include/sysemu/accel-ops.h | 18 +- include/sysemu/cpu-timers.h | 3 +- include/sysemu/qtest.h | 1 + accel/qtest/qtest.c | 1 + accel/tcg/cputlb.c | 4 +- accel/tcg/user-exec.c | 6 +- contrib/plugins/cache.c | 2 +- contrib/plugins/drcov.c | 2 +- contrib/plugins/execlog.c | 2 +- contrib/plugins/hotblocks.c | 2 +- contrib/plugins/hotpages.c | 2 +- contrib/plugins/howvec.c | 2 +- contrib/plugins/hwprofile.c | 2 +- contrib/plugins/iops.c | 260 ++++++++++++++++++ contrib/plugins/lockstep.c | 4 +- plugins/api.c | 22 ++ softmmu/cpus.c | 11 + softmmu/qtest.c | 26 +- ...t-virtual-clock.c => cpus-virtual-clock.c} | 5 + target/arm/tcg/sve_helper.c | 4 - tests/plugin/bb.c | 2 +- tests/plugin/insn.c | 2 +- tests/plugin/mem.c | 2 +- tests/plugin/syscall.c | 2 +- util/qemu-timer.c | 26 ++ contrib/plugins/Makefile | 1 + plugins/qemu-plugins.symbols | 2 + stubs/meson.build | 2 +- tests/tcg/aarch64/Makefile.target | 8 + 33 files changed, 433 insertions(+), 46 deletions(-) create mode 100644 contrib/plugins/iops.c rename stubs/{cpus-get-virtual-clock.c => cpus-virtual-clock.c} (68%)