From nobody Sat May 18 19:24:39 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626937015209401.18394747761965; Wed, 21 Jul 2021 23:56:55 -0700 (PDT) Received: from localhost ([::1]:53182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6SdZ-0001wW-OR for importer@patchew.org; Thu, 22 Jul 2021 02:56:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6SbY-0008QQ-90 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:48 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:43710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6SbW-0006th-St for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:47 -0400 Received: by mail-wr1-x42e.google.com with SMTP id n1so4691876wri.10 for ; Wed, 21 Jul 2021 23:54:45 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id b16sm29245426wrw.46.2021.07.21.23.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 23:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WnusAEAyfZfbEUVNFaz2SidIzioGK97iFgSAymrfuw8=; b=MY6P0k/QX5A2EMelgZVkp4eILJgKq9fxJqSTh46PVSMdYu6xNoFNPGnysRSiXUCPIp FutAFPVP+vlgEss4qMD5XCaF1SSb27joESHbdiXA7lbSW1PCkdGM9W67pHnfaoSCk/S1 iGkIo0eZ9r/zrfKn8UPrup75iqXpGR+HVtZxuavUOPUcgFMvSr7mhEz54N4e+LE6nGW6 H71qsPqcBomhF33eDLd8gJ0bavuDTambTSkILKPkhg06hc+KXvi/GoineBJlfV/zKB5J K47EEIfcRyyx6O+T/3Xzn1/lJaH92AVsIS2pn7bjBhp+MAuo+JsVwMvwtWmP071lKVqI nI0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WnusAEAyfZfbEUVNFaz2SidIzioGK97iFgSAymrfuw8=; b=sXb1uk233R6qGQblu0CIGmEeOp0K9SYoVT6bCOjzYSRafeeTaBnwKNDZ8tJrEjuPwr 41UqfB3eFMYXPIWP0wNXW8wYFmnI13JQDRQV5jDt8/s31wlOy4J9VIRRJ6fh1CiH3cNi 3ASGCgNDowaWYrazT4yY3TsVXhNtqEX4/DTr316vKw9qgsge8z0eUw8WIfXqseMOAFOm xSDPzV5oSCPKOWilefuwTwA+95yOGbIeh5gJcAU7kcW03OmNpm8EjVhS3/0d1rOJDKII lmAtAmPLKPi4Y97DbpY1VjIgV2veHr9J03+jO0b5j/kzE57KpxlKrXzZsAOmUsIkOZ2V aP0Q== X-Gm-Message-State: AOAM5303ortLkMO82FvyOtgkXFEQeSvijlh2vX3KzHGnBzrQnzfiHQIQ k906Ev0lkHTUYmWdnepU29YMAFNxhmo= X-Google-Smtp-Source: ABdhPJydDJCU457bhgqM2Yo8asrGrbPzsQaBZVDgHfdH+Qxl/94QytUiqlSJ6hqPaUgRAIgh8/jWZg== X-Received: by 2002:a5d:464b:: with SMTP id j11mr47076145wrs.356.1626936884426; Wed, 21 Jul 2021 23:54:44 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 1/5] plugins/cache: Fixed a bug with destroying FIFO metadata Date: Thu, 22 Jul 2021 08:54:24 +0200 Message-Id: <20210722065428.134608-2-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722065428.134608-1-ma.mandourr@gmail.com> References: <20210722065428.134608-1-ma.mandourr@gmail.com> MIME-Version: 1.0 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=2a00:1450:4864:20::42e; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42e.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626937017545100001 Content-Type: text/plain; charset="utf-8" This manifests itself when associativity degree is greater than the number of sets and FIFO is used, otherwise it's also a memory leak whenever FIFO was used. Signed-off-by: Mahmoud Mandour --- contrib/plugins/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index bf0d2f6097..4a71602639 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -200,7 +200,7 @@ static void fifo_destroy(Cache *cache) { int i; =20 - for (i =3D 0; i < cache->assoc; i++) { + for (i =3D 0; i < cache->num_sets; i++) { g_queue_free(cache->sets[i].fifo_queue); } } --=20 2.25.1 From nobody Sat May 18 19:24:39 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162693724328774.59756398968375; Thu, 22 Jul 2021 00:00:43 -0700 (PDT) Received: from localhost ([::1]:60044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6ShG-0006YU-6R for importer@patchew.org; Thu, 22 Jul 2021 03:00:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6SbZ-0008R3-Fb for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:49 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45616) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6SbX-0006ux-53 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:49 -0400 Received: by mail-wr1-x432.google.com with SMTP id t5so4694465wrw.12 for ; Wed, 21 Jul 2021 23:54:46 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id b16sm29245426wrw.46.2021.07.21.23.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 23:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rk3htMMb3bfqB/M3qyqhgxhOXapf/D+thLXQN5K9iqg=; b=ZoCEmtH8hlCVw0iT/Bad9K6tiN4/33nlUob0p7V6Z1ZTTRcxDrK1Ncfm4nBLe8iar2 5BvvBFw4h4A0/RUKKtxh6DtPUIprzx67SXXHje2DhlhD3xJNgncR20pvBHEnZkyhnqMS lR4GT2aLuUVm3nJfnYVTV1i5oValyauw0UVQ7nRXLBES36qSVird3wiDsGDCYl7aPcIm faEkuM1fxh93urxaC3k3WpXg6ZaewOjysoFJqgtd3qyM24xMzSf7logllve1VX8WeiA1 WQ1EuakPl2ZhejvQ4qa4WNXTfghHCgydn65LEnKxXt7iGUQLXX0/opt9hTJbtR66LbZs 7xBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rk3htMMb3bfqB/M3qyqhgxhOXapf/D+thLXQN5K9iqg=; b=iROYZa4+PR5T89oRW8qYlK7kHsD2gbUDXo2EJDJzkeDwKRQt5OEo7tT3Ccn2YYzFwR 6FVnK2W2KgHoOdmYDa6/k6R7R+F2pzLV9GZnzV3T/eao++gl9rRUEbPCG+nwfExVKUC4 sT8X5HMRrxbaQSnpkt+NOCNjjvxCZVa8a+8A/kYB8jtz7E6Hj6OxF3qFCdYzuCcds+4m zElqdVUDm6WwaLLuFYj6R0VurdxqViWzaTJCAQd77UjPV36m1EzajHTofejzelTN5fMM VNjt9xdfToMcIPGaFFN0mWCHsSmDyXYVD/D7R7rzDlEVG9HaWOjXE8LT6yFU0w1Mm1VQ h8Mg== X-Gm-Message-State: AOAM531dqmCalyR9YrPZOUi3YX0YI5VpmrMlbtpVUe+KnnZ6cEed66VM 6FXWVWvGANWiqYC+iGOVZF/dTWxWILw= X-Google-Smtp-Source: ABdhPJwrCQT12+3cMb2sSVj+eocHjcNFBJnRoKN/uD/GdwMTUst/dyuz1Zc42xZSdQd/H0V+Xk5Xcg== X-Received: by 2002:adf:e805:: with SMTP id o5mr13880366wrm.321.1626936885692; Wed, 21 Jul 2021 23:54:45 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 2/5] plugins/cache: limited the scope of a mutex lock Date: Thu, 22 Jul 2021 08:54:25 +0200 Message-Id: <20210722065428.134608-3-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722065428.134608-1-ma.mandourr@gmail.com> References: <20210722065428.134608-1-ma.mandourr@gmail.com> MIME-Version: 1.0 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=2a00:1450:4864:20::432; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x432.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626937245004100001 Content-Type: text/plain; charset="utf-8" It's not necessary to lock the address translation portion of the vcpu_mem_access callback. Signed-off-by: Mahmoud Mandour --- contrib/plugins/cache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 4a71602639..695fb969dc 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -355,15 +355,14 @@ static void vcpu_mem_access(unsigned int vcpu_index, = qemu_plugin_meminfo_t info, struct qemu_plugin_hwaddr *hwaddr; InsnData *insn; =20 - g_mutex_lock(&mtx); hwaddr =3D qemu_plugin_get_hwaddr(info, vaddr); if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) { - g_mutex_unlock(&mtx); return; } =20 effective_addr =3D hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vad= dr; =20 + g_mutex_lock(&mtx); if (!access_cache(dcache, effective_addr)) { insn =3D (InsnData *) userdata; insn->dmisses++; --=20 2.25.1 From nobody Sat May 18 19:24:39 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626937397478839.9244958068664; Thu, 22 Jul 2021 00:03:17 -0700 (PDT) Received: from localhost ([::1]:34430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Sjk-0008RP-3w for importer@patchew.org; Thu, 22 Jul 2021 03:03:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6Sba-0008TC-HA for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:50 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:42846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6SbY-0006vj-H4 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:50 -0400 Received: by mail-wr1-x42b.google.com with SMTP id r11so4699431wro.9 for ; Wed, 21 Jul 2021 23:54:48 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id b16sm29245426wrw.46.2021.07.21.23.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 23:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vOjUscqVzJcRPYkS7J51fxMeax0tJPb3jN+fReD0gug=; b=FzTmGIvasPIa1iHYAWUhN4P2PGxNCqu+kxdjraOK1CuSG5gPuwSSoUvubmHysvAWBu E7q8KeWPEyatkwbR052dVnqWaCLyRxo6Z87ryGgmHBlEJNl2ZKEXHpd6QMkqKpkrSMum 2o9U7TPsOC2/Jwbr7DiWwMW4Ciw4HPifp2UtTf10gLkmtUrpHSpumRXLXwnIf6zFqf3v NZ4Na/xQzBf2oV+F9tooxNwdgUpmIouzN8GcpHVBbvZRjkRGMk1+n2y2KWt03nwwjhLC xhRKqdYZSBleFg8UX2fJ7f9NHZaBvOiz6dRQXL/RT28eZeHbPoXznYvSM1vRFa634Dq2 mTow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vOjUscqVzJcRPYkS7J51fxMeax0tJPb3jN+fReD0gug=; b=KLtRYOEhUuBsIv+iCVGQZJJXIMxm7CW9ZX+N8LXwNwbUZ52Upt7mBS5SQOSSrbFhQs K+ff2EUehJWo0tGYHzI8WVuaKPtKuiijDRZeX/joi43iVmh94j2m3VsWipN2nWIGCwVe nKXx3JTT7Pe63TjckEkUui0+YXq+DIBcVqaBTpomAl8PoQUQIe2Nz+xfB2mhMroPLg5R qgLZVeu3MnDrSKJHExZe466G+ttKgttwIsJMs3ANe03iFaycfDGYmfgQ7ZPvAfrKhwaK iC+Y3kwbeuLxfyeLzB3jbNSdQ2gbiIofdcNBbH9GIDm7AgMD5LZmAtr7b45Lo9QQO+fA VfOg== X-Gm-Message-State: AOAM5313qAuFrOgr3YkmWLhVZEYshsPK9KNIpRZ2Em8ERy65KGBu9XgT O+3BRWhC4uB+7wdkksgK4la4ePaGTZA= X-Google-Smtp-Source: ABdhPJxvc/3uqBIvjZTBjmxGlMCkTJZLorv013RnF0d5VkLYxJhYmUsLmlDwBtTxnzW7eI/YweYCFg== X-Received: by 2002:a5d:4e4d:: with SMTP id r13mr46679933wrt.224.1626936886893; Wed, 21 Jul 2021 23:54:46 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 3/5] plugins/cache: Supported multicore cache modelling Date: Thu, 22 Jul 2021 08:54:26 +0200 Message-Id: <20210722065428.134608-4-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722065428.134608-1-ma.mandourr@gmail.com> References: <20210722065428.134608-1-ma.mandourr@gmail.com> MIME-Version: 1.0 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=2a00:1450:4864:20::42b; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42b.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626937398388100001 Content-Type: text/plain; charset="utf-8" Multicore L1 cache modelling is introduced and is supported for both full system emulation and linux-user. For full-system emulation, L1 icache and dcache are maintained for each available core, since this information is exposed to the plugin through `qemu_plugin_n_vcpus()`. For linux-user, a static number of cores is assumed (default 1 core, and can be provided as a plugin argument `cores=3DN`). Every memory access goes through one of these caches, this approach is taken as it's somewhat akin to what happens on real setup, where a program that dispatches more threads than the available cores, they'll thrash each other Signed-off-by: Mahmoud Mandour --- contrib/plugins/cache.c | 154 +++++++++++++++++++++++++++++++--------- 1 file changed, 119 insertions(+), 35 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 695fb969dc..496d6e7d49 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -23,12 +23,6 @@ static GRand *rng; static int limit; static bool sys; =20 -static uint64_t dmem_accesses; -static uint64_t dmisses; - -static uint64_t imem_accesses; -static uint64_t imisses; - enum EvictionPolicy { LRU, FIFO, @@ -90,13 +84,22 @@ typedef struct { uint64_t imisses; } InsnData; =20 +typedef struct { + uint64_t dmem_accesses; + uint64_t dmisses; + uint64_t imem_accesses; + uint64_t imisses; +} CoreStats; + void (*update_hit)(Cache *cache, int set, int blk); void (*update_miss)(Cache *cache, int set, int blk); =20 void (*metadata_init)(Cache *cache); void (*metadata_destroy)(Cache *cache); =20 -Cache *dcache, *icache; +static int cores; +CoreStats *stats; +Cache **dcaches, **icaches; =20 static int pow_of_two(int num) { @@ -233,14 +236,16 @@ static bool bad_cache_params(int blksize, int assoc, = int cachesize) =20 static Cache *cache_init(int blksize, int assoc, int cachesize) { - if (bad_cache_params(blksize, assoc, cachesize)) { - return NULL; - } - Cache *cache; int i; uint64_t blk_mask; =20 + /* + * This function shall not be called directly, and hence expects suita= ble + * parameters. + */ + g_assert(!bad_cache_params(blksize, assoc, cachesize)); + cache =3D g_new(Cache, 1); cache->assoc =3D assoc; cache->cachesize =3D cachesize; @@ -263,6 +268,24 @@ static Cache *cache_init(int blksize, int assoc, int c= achesize) return cache; } =20 +static Cache **caches_init(int blksize, int assoc, int cachesize) +{ + Cache **caches; + int i; + + if (bad_cache_params(blksize, assoc, cachesize)) { + return NULL; + } + + caches =3D g_new(Cache *, cores); + + for (i =3D 0; i < cores; i++) { + caches[i] =3D cache_init(blksize, assoc, cachesize); + } + + return caches; +} + static int get_invalid_block(Cache *cache, uint64_t set) { int i; @@ -353,6 +376,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, qe= mu_plugin_meminfo_t info, { uint64_t effective_addr; struct qemu_plugin_hwaddr *hwaddr; + int cache_idx; InsnData *insn; =20 hwaddr =3D qemu_plugin_get_hwaddr(info, vaddr); @@ -361,14 +385,15 @@ static void vcpu_mem_access(unsigned int vcpu_index, = qemu_plugin_meminfo_t info, } =20 effective_addr =3D hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vad= dr; + cache_idx =3D vcpu_index % cores; =20 g_mutex_lock(&mtx); - if (!access_cache(dcache, effective_addr)) { + if (!access_cache(dcaches[cache_idx], effective_addr)) { insn =3D (InsnData *) userdata; insn->dmisses++; - dmisses++; + stats[cache_idx].dmisses++; } - dmem_accesses++; + stats[cache_idx].dmem_accesses++; g_mutex_unlock(&mtx); } =20 @@ -376,16 +401,18 @@ static void vcpu_insn_exec(unsigned int vcpu_index, v= oid *userdata) { uint64_t insn_addr; InsnData *insn; + int cache_idx; =20 g_mutex_lock(&mtx); insn_addr =3D ((InsnData *) userdata)->addr; + cache_idx =3D vcpu_index % cores; =20 - if (!access_cache(icache, insn_addr)) { + if (!access_cache(icaches[cache_idx], insn_addr)) { insn =3D (InsnData *) userdata; insn->imisses++; - imisses++; + stats[cache_idx].imisses++; } - imem_accesses++; + stats[cache_idx].imem_accesses++; g_mutex_unlock(&mtx); } =20 @@ -453,6 +480,15 @@ static void cache_free(Cache *cache) g_free(cache); } =20 +static void caches_free(Cache **caches) +{ + int i; + + for (i =3D 0; i < cores; i++) { + cache_free(caches[i]); + } +} + static int dcmp(gconstpointer a, gconstpointer b) { InsnData *insn_a =3D (InsnData *) a; @@ -469,21 +505,57 @@ static int icmp(gconstpointer a, gconstpointer b) return insn_a->imisses < insn_b->imisses ? 1 : -1; } =20 +static void append_stats_line(GString *line, CoreStats cs) +{ + double dmiss_rate, imiss_rate; + + dmiss_rate =3D ((double) cs.dmisses) / (cs.dmem_accesses) * 100.0; + imiss_rate =3D ((double) cs.imisses) / (cs.imem_accesses) * 100.0; + + g_string_append_printf(line, "%-14lu %-12lu %9.4lf%% %-14lu %-12lu" + " %9.4lf%%\n", + cs.dmem_accesses, + cs.dmisses, + cs.dmem_accesses ? dmiss_rate : 0.0, + cs.imem_accesses, + cs.imisses, + cs.imem_accesses ? imiss_rate : 0.0); +} + +static void sum_stats(void) +{ + int i; + + g_assert(cores > 1); + for (i =3D 0; i < cores; i++) { + stats[cores].imisses +=3D stats[i].imisses; + stats[cores].dmisses +=3D stats[i].dmisses; + stats[cores].dmem_accesses +=3D stats[i].dmem_accesses; + stats[cores].imem_accesses +=3D stats[i].imem_accesses; + } +} + static void log_stats() { - g_autoptr(GString) rep =3D g_string_new(""); - g_string_append_printf(rep, - "Data accesses: %lu, Misses: %lu\nMiss rate: %lf%%\n\n", - dmem_accesses, - dmisses, - ((double) dmisses / (double) dmem_accesses) * 100.0); - - g_string_append_printf(rep, - "Instruction accesses: %lu, Misses: %lu\nMiss rate: %lf%%\n\n", - imem_accesses, - imisses, - ((double) imisses / (double) imem_accesses) * 100.0); + int i, iters; + + g_autoptr(GString) rep =3D g_string_new("core #, data accesses, data m= isses," + " dmiss rate, insn accesses," + " insn misses, imiss rate\n"); + + /* Only iterate and print a sum row if cores > 1 */ + iters =3D cores =3D=3D 1 ? 1 : cores + 1; + for (i =3D 0; i < iters; i++) { + if (i =3D=3D cores) { + g_string_append_printf(rep, "%-8s", "sum"); + sum_stats(); + } else { + g_string_append_printf(rep, "%-8d", i); + } + append_stats_line(rep, stats[i]); + } =20 + g_string_append(rep, "\n"); qemu_plugin_outs(rep->str); } =20 @@ -530,10 +602,12 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) log_stats(); log_top_insns(); =20 - cache_free(dcache); - cache_free(icache); + caches_free(dcaches); + caches_free(icaches); =20 g_hash_table_destroy(miss_ht); + + g_free(stats); } =20 static void policy_init() @@ -579,6 +653,8 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, =20 policy =3D LRU; =20 + cores =3D sys ? qemu_plugin_n_vcpus() : 1; + for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; if (g_str_has_prefix(opt, "iblksize=3D")) { @@ -595,6 +671,8 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu= _info_t *info, dcachesize =3D g_ascii_strtoll(opt + 11, NULL, 10); } else if (g_str_has_prefix(opt, "limit=3D")) { limit =3D g_ascii_strtoll(opt + 6, NULL, 10); + } else if (g_str_has_prefix(opt, "cores=3D")) { + cores =3D g_ascii_strtoll(opt + 6, NULL, 10); } else if (g_str_has_prefix(opt, "evict=3D")) { gchar *p =3D opt + 6; if (g_strcmp0(p, "rand") =3D=3D 0) { @@ -615,22 +693,28 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qe= mu_info_t *info, =20 policy_init(); =20 - dcache =3D cache_init(dblksize, dassoc, dcachesize); - if (!dcache) { + dcaches =3D caches_init(dblksize, dassoc, dcachesize); + if (!dcaches) { const char *err =3D cache_config_error(dblksize, dassoc, dcachesiz= e); fprintf(stderr, "dcache cannot be constructed from given parameter= s\n"); fprintf(stderr, "%s\n", err); return -1; } =20 - icache =3D cache_init(iblksize, iassoc, icachesize); - if (!icache) { + icaches =3D caches_init(iblksize, iassoc, icachesize); + if (!icaches) { const char *err =3D cache_config_error(iblksize, iassoc, icachesiz= e); fprintf(stderr, "icache cannot be constructed from given parameter= s\n"); fprintf(stderr, "%s\n", err); return -1; } =20 + /* + * plus one to save the sum in. If only one core is used then no need = to + * get an auxiliary struct. + */ + stats =3D g_new0(CoreStats, cores =3D=3D 1 ? 1 : cores + 1); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); =20 --=20 2.25.1 From nobody Sat May 18 19:24:39 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626937019712338.81021233930846; Wed, 21 Jul 2021 23:56:59 -0700 (PDT) Received: from localhost ([::1]:53590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Sde-0002Dr-CF for importer@patchew.org; Thu, 22 Jul 2021 02:56:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6Sbb-0008UF-3p for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:51 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:42542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6SbZ-0006x2-OJ for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:50 -0400 Received: by mail-wm1-x331.google.com with SMTP id a23-20020a05600c2257b0290236ec98bebaso2313487wmm.1 for ; Wed, 21 Jul 2021 23:54:49 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id b16sm29245426wrw.46.2021.07.21.23.54.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 23:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jcYcrXSu+KqlQ/6QrGFdUV6rCUe9Kbh1qvz/TUIqCys=; b=EjXwaD5275dJT6MSYAgr2Yh0s5/Y7t8NSrsoZzq63xik/JNVA8J21ikdmP9y2m97/6 Dl7BIvPT1XtiOFWuBlpKezj66I2FdL8ZfQ+d2llk+oG/49q4VmJrn16NBAoPS3bJx7P8 xgvEzNi654JCRFm0KYQfp4RYwBSthv8ZDOhnu8a4jRKbIzD/AMSNPrUmYoGjgpkxcmYm b5QFZMqnaZPwVUlf7P5Yz42F5uKDEGZtDBL5NEyx282Y9ugcqaGTk8VyQtDYE/99hIuh 4RcKtx5VA0sHpphn0OemYGz2pB+KWompIJwoNG8MZjT4UmMNaaNDElJ647AcZG6jlU+9 zGdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jcYcrXSu+KqlQ/6QrGFdUV6rCUe9Kbh1qvz/TUIqCys=; b=mOEJhqieaG0CYui57TlEwLCzG+d3vVPD7ihNdzIMp3MshFq53+i2rCTgNgYI1+iewP onwTrz8wTaS/rQEDLNCM+uPHzDMV94zj6ckXvRuoX7k/OZrUaoCZDMh8kaZEXjSNia1A 8BqObctKz18rMknJ/j8mfQJz8GOiV64C7nQHQN/wCentMlG6uTCjEBq4oKMKBdo9qWbQ ZIuispKjiKUrANTxwupngqVsb/Y2NEjvv73hkO9m8BBsmwVBgMrlso9a6znf/sJnH+Yi b6WH+lYtZlgyThhGl3ZO+ImbpLCymOrubsp66F+R6aKYWhNgt2Qw9sAyhdQH3YnX5KOJ r8FA== X-Gm-Message-State: AOAM532BnNbP4AQbTbsiK99EJFtzNGF3Oyl7sJx3cj1kYi19MvKaEdXW VNOxPnqUc/JC6MCDVcr0gKcEbVhHkyA= X-Google-Smtp-Source: ABdhPJxyPgRNZQTC/LXtUrvxIDmjDRrUk6CXsx8zEP0jvyIR24Nuw0RmxhvvqkleiOE5Cg6JEMvHxw== X-Received: by 2002:a1c:4d14:: with SMTP id o20mr7159995wmh.89.1626936888180; Wed, 21 Jul 2021 23:54:48 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 4/5] docs/devel/tcg-plugins: added cores arg to cache plugin Date: Thu, 22 Jul 2021 08:54:27 +0200 Message-Id: <20210722065428.134608-5-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722065428.134608-1-ma.mandourr@gmail.com> References: <20210722065428.134608-1-ma.mandourr@gmail.com> MIME-Version: 1.0 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=2a00:1450:4864:20::331; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x331.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626937021155100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- docs/devel/tcg-plugins.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 595b8e0ea4..370c11373f 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -330,11 +330,8 @@ configuration when a given working set is run:: =20 will report the following:: =20 - Data accesses: 996479, Misses: 507 - Miss rate: 0.050879% - - Instruction accesses: 2641737, Misses: 18617 - Miss rate: 0.704726% + core #, data accesses, data misses, dmiss rate, insn accesses, insn mi= sses, imiss rate + 0 996695 508 0.0510% 2642799 18617 = 0.7044% =20 address, data misses, instruction 0x424f1e (_int_malloc), 109, movq %rax, 8(%rcx) @@ -378,3 +375,9 @@ The plugin has a number of arguments, all of them are o= ptional: Sets the eviction policy to POLICY. Available policies are: :code:`lru`, :code:`fifo`, and :code:`rand`. The plugin will use the specified policy= for both instruction and data caches. (default: POLICY =3D :code:`lru`) + + * arg=3D"cores=3DN" + + Sets the number of cores for which we maintain separate icache and dcach= e. + (default: for linux-user, N =3D 1, for full system emulation: N =3D cores + available to guest) --=20 2.25.1 From nobody Sat May 18 19:24:39 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626937020020398.2421665538661; Wed, 21 Jul 2021 23:57:00 -0700 (PDT) Received: from localhost ([::1]:53614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Sdf-0002F9-1V for importer@patchew.org; Thu, 22 Jul 2021 02:56:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6Sbc-00004r-4I for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:52 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:39698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6Sba-0006xz-OL for qemu-devel@nongnu.org; Thu, 22 Jul 2021 02:54:51 -0400 Received: by mail-wr1-x42c.google.com with SMTP id f17so4708067wrt.6 for ; Wed, 21 Jul 2021 23:54:50 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id b16sm29245426wrw.46.2021.07.21.23.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 23:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/xVDywL+q5JpXQhN2A4F3STnAn6KlKWnwZ97uKe26WU=; b=LRnq1siYwm8bpJK36qvHeBf82nrMc+Jz3C8cajsct6kew+4s8rsLEABxIaxk0Tlt7X i5NaFiGNLgwfztBQGEGezTRxf5tKhL3X8YeX87BpWsdPW8hANrvEEbC8N5D+G+/cI86L 5fbuJOuB0yMrp4MKblXfmuPHkEVyWBl431Hyfojw3U8nDnuPjF8Dsj1W1/ljzjr/x+H3 beAPqfcoK1QMsNbA1PxRFgoyhdjfIxwnSpyszkuy1C431BARrpRIjndrvkix4lTafejv tMTR2aCfS0diPnlliF8wOVbTzcCEC4jiks4DP+pKcOZnJFwF72zClQPZniJFOlNCtJob +BFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/xVDywL+q5JpXQhN2A4F3STnAn6KlKWnwZ97uKe26WU=; b=R/dUyLrX3dhDBw2P8/5p9Y8dyFfcGgnjW482n/RZ42dGPy7jSkasLcf4vEG0KUp+l0 zsAZX9ZRpJ8R7nPt0DrhfM4QAJ2130QDiTvEovtlkMe7OWySn9MxX2oC5VDXCoYVHP4n x091C7qureqjuDaM53Oa00C7R7AHFU8X09L/omB948xZ39xEFBddagoerlGEowEbPJCD maql1p99jSS13zYIzt/aldHUu8IeWLUrpbb60wlil/VhMNG8RkhOIrffR4xcTM16cId6 hAlzbjpjSyyJcUqqZXG57IAb9x16BheUqNK24yq2yo+M14bFs2Jsobnic9UJENxaXFCj 8G9w== X-Gm-Message-State: AOAM530UEYZWrNAe2mYxILSCsX8A72UqqVogy6yCbvX3TEgRr1u9J9tz NhFs97Jg/WTo+wAveYDzgMvLSXYoSog= X-Google-Smtp-Source: ABdhPJyWshi+BjH88n1H3O/rTm8MTIg72WAMfDuX5hivym2O4QUNv2an6yx4Kv9mSsvbbiZ/pbrSPw== X-Received: by 2002:a5d:456d:: with SMTP id a13mr14761026wrc.255.1626936889310; Wed, 21 Jul 2021 23:54:49 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 5/5] plugins/cache: Fixed "function decl. is not a prototype" warnings Date: Thu, 22 Jul 2021 08:54:28 +0200 Message-Id: <20210722065428.134608-6-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722065428.134608-1-ma.mandourr@gmail.com> References: <20210722065428.134608-1-ma.mandourr@gmail.com> MIME-Version: 1.0 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=2a00:1450:4864:20::42c; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42c.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626937021153100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- contrib/plugins/cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 496d6e7d49..cc9020b2d5 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -535,7 +535,7 @@ static void sum_stats(void) } } =20 -static void log_stats() +static void log_stats(void) { int i, iters; =20 @@ -559,7 +559,7 @@ static void log_stats() qemu_plugin_outs(rep->str); } =20 -static void log_top_insns() +static void log_top_insns(void) { int i; GList *curr, *miss_insns; @@ -610,7 +610,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) g_free(stats); } =20 -static void policy_init() +static void policy_init(void) { switch (policy) { case LRU: --=20 2.25.1