From patchwork Thu Jan 11 14:23:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 761850 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2422612wrz; Thu, 11 Jan 2024 06:25:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHep9oc4G9t5+hi0D37qwCshlnQ0A2XWaKIcRiff6YUydN12RMqMryKc/oStS/VTqLYcmLC X-Received: by 2002:a0c:dd0a:0:b0:680:b789:97d8 with SMTP id u10-20020a0cdd0a000000b00680b78997d8mr1002924qvk.126.1704983118799; Thu, 11 Jan 2024 06:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704983118; cv=none; d=google.com; s=arc-20160816; b=Twh7tzfWWXaYDea9ol8d06YcKjR8JvC+/eQmFalZJNpBv1XPfA+ci/siK6pAqFVeix F/4/hAtWEDIXz96m4MV4bIF1uYtIOlc8HQ3gfXy7Guo/JpkVoImPC1pnOPfnHh91Y4I2 IK1BwMV1e4iMM/NzLBKzBOS0n21Zp727SzS/5RBaRKtHIx/2kD9L9RxHgpMQDAI4e/il HqiTWDEhXpvjs7XHbVnETkU5B1rebUwi0IbjAZZj2iQRbZehMJ4IuiDrktUeVr13U5Mn 2jvvEY6G5k4+eaHCLnXdSa76ZY9XniGda+6+SW9ocvYiACot4S5y0dLFXQbVVkEUDwju HVvg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xFv6E5kkXfIGfEX1pT8iilVpb1LB0Hjh6FDK0KUik1o=; fh=4xQMyYYtmbynAmJxwWPpZ6ivTwZNkSfAt6fhFI9aNBQ=; b=HGhH2Pr8swWdOSUFNXHkB5UvDlel14HpujsFNULaY/lRsAVhnARHcy1vL7TglPoMXA R6SKtRSQphzhGP4ghkWpiItn4jY1wsJWI27t/5BhgiwK2ka5x2d2roujb6J5fwA11lLi TJgO1mOvgptpCLn1EzikDyv+YrO/dmIGn2AHSWbenOAVMc58hpnISCPrqdpRk+uKvFH7 L9381LHQx7uXVA58DCC2ge2KjxdesNLjQFar8QzrrYczKoucZX08x0MmPrmaKK9KtxC9 IuUMJB+BMbOZaQvU6n3YmJa0a9o0detEni3iWOwhDjSZIx0kqvSpYHj3bPiY1zqMHhZB osgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GMitChlb; 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 p10-20020a0ce18a000000b006803463703bsi878824qvl.129.2024.01.11.06.25.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2024 06:25:18 -0800 (PST) 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=GMitChlb; 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 1rNvyV-0004Mb-Dz; Thu, 11 Jan 2024 09:24:03 -0500 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 1rNvyR-0004LR-Jx for qemu-devel@nongnu.org; Thu, 11 Jan 2024 09:24:00 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNvyN-0002QX-FI for qemu-devel@nongnu.org; Thu, 11 Jan 2024 09:23:59 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3367a304091so4690002f8f.3 for ; Thu, 11 Jan 2024 06:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704983033; x=1705587833; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xFv6E5kkXfIGfEX1pT8iilVpb1LB0Hjh6FDK0KUik1o=; b=GMitChlbw9fHcIenm3QtyIOZdslthxohFULnifPccdh6uFrGzVJBz2Q7Gt1HDX8Nrn v1U8bdgkpu/W5Na0DPaIPTtCWRc3wDNcZ4Zrd75HM9aDexUAAAcGv8x479a+3RgN9PPq R2kRliVelgWhp5ZcKn6+lycO2Kh7H4jSUnIaBJlgvPKYTdkRhI6DalwZ353c0XtbTrje 7z6lEk/W35bRgQPmBWP20dKNey8/xBpTEQmYZeys736segLCumkT8WUUCPVvVEjtgHz9 Of30+UhofC77QbCi2cjrtB8+xrwL5jUcinXEcZdNFHq4JlLl3ZjfqQHyv2SmD1yv5Ez7 ztJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704983033; x=1705587833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xFv6E5kkXfIGfEX1pT8iilVpb1LB0Hjh6FDK0KUik1o=; b=RrBsMJZ8kbsW7Fw/npwsDAFprTaIQheXyj+O8nTS5e4UMQVdjqQuS2t16FE/aYm0ox 4kS0xvzSUYyChsowDieIzNNWDpHeRE9hbbpyeueCbAXHl/xqeHBpisApA4KcedMlKBlP QKyN1r5hgvw8Gqbw1Y9YEpb7krWezGnV1PkRqYgqHbLygyCznCZsf6YbFNCgEBrNsDuk i5rNwVIpI121wyEl2J3xccH8OVO5lBgvjfLuwJhwWHnGznboj4OOOpI5Um63t9dF6Xwd qdSP+BC1Ign7yJ/QZQG3vrexIjELlq43dFO+HK90C7Jeih26K0+dF7P9DpEosCSX+gmJ utzQ== X-Gm-Message-State: AOJu0YwhM09oq7QH00YdeSPtMJ69XzY0Ll/Oq4dfJdXuLr7PJIKl/dpk rP/XdZy76OOPaIyGV92+0OU+rLJiFpog8j1pUTPHZe+66tg3xA== X-Received: by 2002:adf:cd07:0:b0:336:5bf4:9904 with SMTP id w7-20020adfcd07000000b003365bf49904mr430816wrm.142.1704983033223; Thu, 11 Jan 2024 06:23:53 -0800 (PST) Received: from linaro.. ([102.35.208.160]) by smtp.gmail.com with ESMTPSA id h7-20020adff4c7000000b0033677aae2e2sm1349000wrp.107.2024.01.11.06.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 06:23:52 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Mahmoud Mandour , Richard Henderson , Paolo Bonzini , Alexandre Iooss Subject: [PATCH 04/12] tests/plugin/inline: migrate to new per_vcpu API Date: Thu, 11 Jan 2024 18:23:17 +0400 Message-ID: <20240111142326.1743444-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240111142326.1743444-1-pierrick.bouvier@linaro.org> References: <20240111142326.1743444-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x436.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 Signed-off-by: Pierrick Bouvier --- tests/plugin/inline.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/plugin/inline.c b/tests/plugin/inline.c index 6114ebca545..ae59f7af7a7 100644 --- a/tests/plugin/inline.c +++ b/tests/plugin/inline.c @@ -18,15 +18,12 @@ static uint64_t count_tb; static uint64_t count_tb_per_vcpu[MAX_CPUS]; static uint64_t count_tb_inline_per_vcpu[MAX_CPUS]; -static uint64_t count_tb_inline_racy; static uint64_t count_insn; static uint64_t count_insn_per_vcpu[MAX_CPUS]; static uint64_t count_insn_inline_per_vcpu[MAX_CPUS]; -static uint64_t count_insn_inline_racy; static uint64_t count_mem; static uint64_t count_mem_per_vcpu[MAX_CPUS]; static uint64_t count_mem_inline_per_vcpu[MAX_CPUS]; -static uint64_t count_mem_inline_racy; static GMutex tb_lock; static GMutex insn_lock; static GMutex mem_lock; @@ -50,11 +47,9 @@ static void stats_insn(void) printf("insn: %" PRIu64 "\n", expected); printf("insn: %" PRIu64 " (per vcpu)\n", per_vcpu); printf("insn: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu); - printf("insn: %" PRIu64 " (inline racy)\n", count_insn_inline_racy); g_assert(expected > 0); g_assert(per_vcpu == expected); g_assert(inl_per_vcpu == expected); - g_assert(count_insn_inline_racy <= expected); } static void stats_tb(void) @@ -65,11 +60,9 @@ static void stats_tb(void) printf("tb: %" PRIu64 "\n", expected); printf("tb: %" PRIu64 " (per vcpu)\n", per_vcpu); printf("tb: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu); - printf("tb: %" PRIu64 " (inline racy)\n", count_tb_inline_racy); g_assert(expected > 0); g_assert(per_vcpu == expected); g_assert(inl_per_vcpu == expected); - g_assert(count_tb_inline_racy <= expected); } static void stats_mem(void) @@ -80,11 +73,9 @@ static void stats_mem(void) printf("mem: %" PRIu64 "\n", expected); printf("mem: %" PRIu64 " (per vcpu)\n", per_vcpu); printf("mem: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu); - printf("mem: %" PRIu64 " (inline racy)\n", count_mem_inline_racy); g_assert(expected > 0); g_assert(per_vcpu == expected); g_assert(inl_per_vcpu == expected); - g_assert(count_mem_inline_racy <= expected); } static void plugin_exit(qemu_plugin_id_t id, void *udata) @@ -142,8 +133,6 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) { qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, QEMU_PLUGIN_CB_NO_REGS, 0); - qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64, - &count_tb_inline_racy, 1); qemu_plugin_register_vcpu_tb_exec_inline_per_vcpu( tb, QEMU_PLUGIN_INLINE_ADD_U64, count_tb_inline_per_vcpu, sizeof(uint64_t), 1); @@ -152,18 +141,12 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, idx); qemu_plugin_register_vcpu_insn_exec_cb(insn, vcpu_insn_exec, QEMU_PLUGIN_CB_NO_REGS, 0); - qemu_plugin_register_vcpu_insn_exec_inline( - insn, QEMU_PLUGIN_INLINE_ADD_U64, - &count_insn_inline_racy, 1); qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu( insn, QEMU_PLUGIN_INLINE_ADD_U64, count_insn_inline_per_vcpu, sizeof(uint64_t), 1); qemu_plugin_register_vcpu_mem_cb(insn, &vcpu_mem_access, QEMU_PLUGIN_CB_NO_REGS, QEMU_PLUGIN_MEM_RW, 0); - qemu_plugin_register_vcpu_mem_inline(insn, QEMU_PLUGIN_MEM_RW, - QEMU_PLUGIN_INLINE_ADD_U64, - &count_mem_inline_racy, 1); qemu_plugin_register_vcpu_mem_inline_per_vcpu( insn, QEMU_PLUGIN_MEM_RW, QEMU_PLUGIN_INLINE_ADD_U64,