From patchwork Wed Jul 21 10:36:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahmoud Abumandour X-Patchwork-Id: 1508121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=h/8icZVa; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVBq850MKz9sRf for ; Wed, 21 Jul 2021 20:37:24 +1000 (AEST) Received: from localhost ([::1]:49052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69bO-00044P-DV for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2021 06:37:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m69ar-00040O-8A for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:49 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m69ap-00057E-Hm for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:48 -0400 Received: by mail-wr1-x436.google.com with SMTP id t5so1617163wrw.12 for ; Wed, 21 Jul 2021 03:36: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=WnusAEAyfZfbEUVNFaz2SidIzioGK97iFgSAymrfuw8=; b=h/8icZVaM5HMSX5NQLxksO/THCIi5JEhwIedcep0/y2LY2DJYcxKMAflfiy6ylFThq 2uCPgUKzSDtcYJQXn+oIrdv5Pp9Oc+fS2kYCZXPtqwSau9UkxDiXyGDHZMyBs4nDVWPo 0/OxOfc2mfUehhJhAQtrbyeNW77zYjKhn7a8paNp3WUlmK3g6K1YQQR4MsukuWlzhHWZ LXjABV9Mnuxa4RrBCNgL4j/ypx1L7miizZAEPHHXWAvU6Ggl4Xg2/bvsHhPkJI99CH0q RvruID1ct2+cqLd8nWpg1EG3spAR+NEcIsgIzIrOGKUmz0wYCWZB3nYPCxYlKcVAu1KQ pEeg== 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=lFFC7Ac4seY2y1/9LcwtEFFhzEWd9byvuzuRGdVD4G55Teabb+zpxUKKDTu1wxY1fk zoRn2hGVUKy/bSMrTJiGxzQZYlPw7DhxKuv0hcSyoZmlI00pov+CiNqWy94Ji6LgvJau Z+iFH20xf7MTbmHWHm2NXpJKImup8wWsdJZki5e6qLXtNkTrBCCsbB2p/Bgv9Y5W/8rm FITQ3sOo7nQtq3oiPqPjLSoDaLflJyS6itFuSJ6MqG4XK/A8FLJ3yKDALjy3L41tlOTP jjeIEBW0ldTNeIT/OqWfZzNscN2L8vBugAeoJmBre2tBqSlGcyhBiEA0b18c1mDJBoux 9j6A== X-Gm-Message-State: AOAM533O2N+ks3jwouf3VU59dWlRilIyDm4plz8BZK5hKKLwGy9AwSWo jD0uvQnc51oFUyzYMtr01gzbMsMFM4g= X-Google-Smtp-Source: ABdhPJxQ2zf5MEGk7h9i2YQ2Px+QF5CKbaQ4Vj1F+9kTAJvRHsV3uaFgZRMKEQDW7xUGEoT5L093qQ== X-Received: by 2002:adf:f949:: with SMTP id q9mr40451606wrr.178.1626863805951; Wed, 21 Jul 2021 03:36:45 -0700 (PDT) Received: from localhost.localdomain ([102.47.167.62]) by smtp.gmail.com with ESMTPSA id s24sm28854019wra.33.2021.07.21.03.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:36:45 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v2 1/5] plugins/cache: Fixed a bug with destroying FIFO metadata Date: Wed, 21 Jul 2021 12:36:07 +0200 Message-Id: <20210721103612.48844-2-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721103612.48844-1-ma.mandourr@gmail.com> References: <20210721103612.48844-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=ma.mandourr@gmail.com; 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, 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_?= =?utf-8?q?Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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; - for (i = 0; i < cache->assoc; i++) { + for (i = 0; i < cache->num_sets; i++) { g_queue_free(cache->sets[i].fifo_queue); } } From patchwork Wed Jul 21 10:36:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahmoud Abumandour X-Patchwork-Id: 1508128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=kECJ5uUM; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVByP4p8fz9sWd for ; Wed, 21 Jul 2021 20:43:41 +1000 (AEST) Received: from localhost ([::1]:40794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69hT-0000Ve-CT for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2021 06:43:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m69as-00045T-TL for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:50 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:42689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m69ar-00058W-7T for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:50 -0400 Received: by mail-wr1-x431.google.com with SMTP id r11so1623527wro.9 for ; Wed, 21 Jul 2021 03:36:48 -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=kECJ5uUMYsBFl3gH2zuDE5inU8gTtZF8byA+S0pbFALEeL1p3XcU0mXV0iWdUdaMYu jiitQ4/hQpBFuomTEtcaOIZFCcZmr0z3OtTFHiLWyNO1kLh1N2QbUFbqGoLBGWJQf+am XoLjXrJ/5N8lKq1RmMRUGs+dc0Q8sZ4kM5JZUPNw4S1W7CwOOvkt/0H/zmaFLnbU04L8 ulv/og0FaPPrOW2WelEfP9nu3AUVeFVPvj8AAmvFic9GVOpeyllDPSD30rp2Lme0Q7ae vE0aGrRwDAO5nXeqo5S0HPAory/QawP126HlF1eM0N4er+xKH18xj+2D3SYqm/1xv3rG 0TAQ== 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=faVyjXkX8ocI2iRh8tGHpCUaeRQoRxigLv1m7BrwsmOsl84vHhAyzB03rhs/hrIwRJ DLFkkTr/QtJbR2lLMtvL2k5m0Pjn+bc08A7hB9KREYBAMtYvPMsCt760ARsS7Gzwq6zN AVQXOgeLe9avYG7lwfhVCz5+0btKOObhC7Fuc6dPlBrh7aRcOD1T+aUeQ35mUTqocMGs KsK0KbTuPh45XSqNZu8P/FfNy/IThFgO6cUG1DPkC0k46Lnidl9QQaUhh7NP+7Ey+Vz7 iZMOuac5j9H2QoogV1LIHHd6Lv2YyHfaannjo/HtLTWd9nXTjB4LyWnRD+A6/PWi6wT1 dPJg== X-Gm-Message-State: AOAM53257ErDlAfHm9p/1Eo9VmvcvYIrlfYMU7gMROZ7UvtNWyQcniYy AT1HaegFA3a9Fc1kbVI8eEIdG8GGH84= X-Google-Smtp-Source: ABdhPJynVV5Z3K/plSBb3YTOqXWwSubr+ZEKESZmOV1yoU61mW3jq/CjP2i7ivIw52IzXXutSnNbfg== X-Received: by 2002:adf:eccf:: with SMTP id s15mr40895109wro.176.1626863807560; Wed, 21 Jul 2021 03:36:47 -0700 (PDT) Received: from localhost.localdomain ([102.47.167.62]) by smtp.gmail.com with ESMTPSA id s24sm28854019wra.33.2021.07.21.03.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:36:46 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v2 2/5] plugins/cache: limited the scope of a mutex lock Date: Wed, 21 Jul 2021 12:36:08 +0200 Message-Id: <20210721103612.48844-3-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721103612.48844-1-ma.mandourr@gmail.com> References: <20210721103612.48844-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x431.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_?= =?utf-8?q?Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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; - g_mutex_lock(&mtx); hwaddr = qemu_plugin_get_hwaddr(info, vaddr); if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) { - g_mutex_unlock(&mtx); return; } effective_addr = hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vaddr; + g_mutex_lock(&mtx); if (!access_cache(dcache, effective_addr)) { insn = (InsnData *) userdata; insn->dmisses++; From patchwork Wed Jul 21 10:36:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahmoud Abumandour X-Patchwork-Id: 1508132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=i994gDG5; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVC7K2fKFz9sWS for ; Wed, 21 Jul 2021 20:51:25 +1000 (AEST) Received: from localhost ([::1]:35792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69ov-0007bY-Pg for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2021 06:51:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m69au-0004CA-Lh for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:52 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:54118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m69as-00058m-Gt for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:52 -0400 Received: by mail-wm1-x329.google.com with SMTP id w13so1028477wmc.3 for ; Wed, 21 Jul 2021 03:36:50 -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=i994gDG5GExCD+qznygtrzybbf2GM9g1lgwO0Mz55wdCZg3URjvth6G1+76nQ6qSDX SHCUNhySjW/cdtJkWvpDgUdIROFYnNz9EEa7DQF0DdUlDqfWQDmUi9xn/L+7vo5QbSjK exwLiFgO8m2Wf+Kr8sPVtRWwxvj+ctCVLNmbxgipvdhEyb5+SGdJlgd+P5jWbU91LAKA qAwTz5J/Ci//DP3KnmFIntpc6Mfu7Cfku4VbZUIfiHssTG+G6vcsRJJxfjCiaolj8uTy rDGkwOg1RxFxkzUL9LwDC8pL9HIX2VHZ1U63KG1yXah2ugwtNdDUgc7LvGrFoboi/YBP Ssnw== 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=LY++LMMunFHw3jquVPgQmPnzNbZp0vgwyIFyp0XtiIC0vNnW7SJ50Ci8qV/SdDX6LE DWh3/lgbyKHXBHgIW/VRuGV65jd4A9ckayA+MrbenZe+x7ppikVfwmbND59QErhiQ7m7 Uuv6FvJWSlDLqsewLeW4XT3ErBf5eBoD2EYoMg31dv5vUTHjjzf0wrRA5xq6ZBwR6WTm Wmt8eEiVTW4psctPgaQeeuk4BiPgQH2Th6yL1DQXkLx5xHkdKpa5jM2xpjxECJVzLrcw WDKLCX/Lt3opkfKjcKo8pVfPmyvMq0zONDc35i/pcirEa34ksI0E8JhGdJuw7yIrAz7x ZuaQ== X-Gm-Message-State: AOAM530cWu6ptiyluA9FaK5M6a/GVV/AGBtgOi9ohNNPRxMN5gKxoxDm mp0tplMqMHqpMTmpE5XDuTHbfhwFpqY= X-Google-Smtp-Source: ABdhPJzdm6b+G6WGejuzKIuCYpt8PfUdvOUcDI17x6UYne+ffIC/yXDKmLBwf9RCWgiBzccNn3vWng== X-Received: by 2002:a1c:f705:: with SMTP id v5mr3353122wmh.69.1626863808834; Wed, 21 Jul 2021 03:36:48 -0700 (PDT) Received: from localhost.localdomain ([102.47.167.62]) by smtp.gmail.com with ESMTPSA id s24sm28854019wra.33.2021.07.21.03.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:36:48 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v2 3/5] plugins/cache: Supported multicore cache modelling Date: Wed, 21 Jul 2021 12:36:09 +0200 Message-Id: <20210721103612.48844-4-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721103612.48844-1-ma.mandourr@gmail.com> References: <20210721103612.48844-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x329.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_?= =?utf-8?q?Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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=N`). 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; -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; +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); void (*metadata_init)(Cache *cache); void (*metadata_destroy)(Cache *cache); -Cache *dcache, *icache; +static int cores; +CoreStats *stats; +Cache **dcaches, **icaches; static int pow_of_two(int num) { @@ -233,14 +236,16 @@ static bool bad_cache_params(int blksize, int assoc, int cachesize) 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; + /* + * This function shall not be called directly, and hence expects suitable + * parameters. + */ + g_assert(!bad_cache_params(blksize, assoc, cachesize)); + cache = g_new(Cache, 1); cache->assoc = assoc; cache->cachesize = cachesize; @@ -263,6 +268,24 @@ static Cache *cache_init(int blksize, int assoc, int cachesize) return cache; } +static Cache **caches_init(int blksize, int assoc, int cachesize) +{ + Cache **caches; + int i; + + if (bad_cache_params(blksize, assoc, cachesize)) { + return NULL; + } + + caches = g_new(Cache *, cores); + + for (i = 0; i < cores; i++) { + caches[i] = 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, qemu_plugin_meminfo_t info, { uint64_t effective_addr; struct qemu_plugin_hwaddr *hwaddr; + int cache_idx; InsnData *insn; hwaddr = qemu_plugin_get_hwaddr(info, vaddr); @@ -361,14 +385,15 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info, } effective_addr = hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vaddr; + cache_idx = vcpu_index % cores; g_mutex_lock(&mtx); - if (!access_cache(dcache, effective_addr)) { + if (!access_cache(dcaches[cache_idx], effective_addr)) { insn = (InsnData *) userdata; insn->dmisses++; - dmisses++; + stats[cache_idx].dmisses++; } - dmem_accesses++; + stats[cache_idx].dmem_accesses++; g_mutex_unlock(&mtx); } @@ -376,16 +401,18 @@ static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata) { uint64_t insn_addr; InsnData *insn; + int cache_idx; g_mutex_lock(&mtx); insn_addr = ((InsnData *) userdata)->addr; + cache_idx = vcpu_index % cores; - if (!access_cache(icache, insn_addr)) { + if (!access_cache(icaches[cache_idx], insn_addr)) { insn = (InsnData *) userdata; insn->imisses++; - imisses++; + stats[cache_idx].imisses++; } - imem_accesses++; + stats[cache_idx].imem_accesses++; g_mutex_unlock(&mtx); } @@ -453,6 +480,15 @@ static void cache_free(Cache *cache) g_free(cache); } +static void caches_free(Cache **caches) +{ + int i; + + for (i = 0; i < cores; i++) { + cache_free(caches[i]); + } +} + static int dcmp(gconstpointer a, gconstpointer b) { InsnData *insn_a = (InsnData *) a; @@ -469,21 +505,57 @@ static int icmp(gconstpointer a, gconstpointer b) return insn_a->imisses < insn_b->imisses ? 1 : -1; } +static void append_stats_line(GString *line, CoreStats cs) +{ + double dmiss_rate, imiss_rate; + + dmiss_rate = ((double) cs.dmisses) / (cs.dmem_accesses) * 100.0; + imiss_rate = ((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 = 0; i < cores; i++) { + stats[cores].imisses += stats[i].imisses; + stats[cores].dmisses += stats[i].dmisses; + stats[cores].dmem_accesses += stats[i].dmem_accesses; + stats[cores].imem_accesses += stats[i].imem_accesses; + } +} + static void log_stats() { - g_autoptr(GString) rep = 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 = g_string_new("core #, data accesses, data misses," + " dmiss rate, insn accesses," + " insn misses, imiss rate\n"); + + /* Only iterate and print a sum row if cores > 1 */ + iters = cores == 1 ? 1 : cores + 1; + for (i = 0; i < iters; i++) { + if (i == cores) { + g_string_append_printf(rep, "%-8s", "sum"); + sum_stats(); + } else { + g_string_append_printf(rep, "%-8d", i); + } + append_stats_line(rep, stats[i]); + } + g_string_append(rep, "\n"); qemu_plugin_outs(rep->str); } @@ -530,10 +602,12 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) log_stats(); log_top_insns(); - cache_free(dcache); - cache_free(icache); + caches_free(dcaches); + caches_free(icaches); g_hash_table_destroy(miss_ht); + + g_free(stats); } static void policy_init() @@ -579,6 +653,8 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, policy = LRU; + cores = sys ? qemu_plugin_n_vcpus() : 1; + for (i = 0; i < argc; i++) { char *opt = argv[i]; if (g_str_has_prefix(opt, "iblksize=")) { @@ -595,6 +671,8 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, dcachesize = g_ascii_strtoll(opt + 11, NULL, 10); } else if (g_str_has_prefix(opt, "limit=")) { limit = g_ascii_strtoll(opt + 6, NULL, 10); + } else if (g_str_has_prefix(opt, "cores=")) { + cores = g_ascii_strtoll(opt + 6, NULL, 10); } else if (g_str_has_prefix(opt, "evict=")) { gchar *p = opt + 6; if (g_strcmp0(p, "rand") == 0) { @@ -615,22 +693,28 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, policy_init(); - dcache = cache_init(dblksize, dassoc, dcachesize); - if (!dcache) { + dcaches = caches_init(dblksize, dassoc, dcachesize); + if (!dcaches) { const char *err = cache_config_error(dblksize, dassoc, dcachesize); fprintf(stderr, "dcache cannot be constructed from given parameters\n"); fprintf(stderr, "%s\n", err); return -1; } - icache = cache_init(iblksize, iassoc, icachesize); - if (!icache) { + icaches = caches_init(iblksize, iassoc, icachesize); + if (!icaches) { const char *err = cache_config_error(iblksize, iassoc, icachesize); fprintf(stderr, "icache cannot be constructed from given parameters\n"); fprintf(stderr, "%s\n", err); return -1; } + /* + * plus one to save the sum in. If only one core is used then no need to + * get an auxiliary struct. + */ + stats = g_new0(CoreStats, cores == 1 ? 1 : cores + 1); + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); From patchwork Wed Jul 21 10:36:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahmoud Abumandour X-Patchwork-Id: 1508133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tvIUUkCI; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVC9l2Q0wz9sRf for ; Wed, 21 Jul 2021 20:53:31 +1000 (AEST) Received: from localhost ([::1]:42734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69qy-00042d-DO for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2021 06:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m69aw-0004Gu-0F for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:54 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:41594) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m69at-00059l-Jb for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:53 -0400 Received: by mail-wr1-x431.google.com with SMTP id k4so1631033wrc.8 for ; Wed, 21 Jul 2021 03:36:51 -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=tvIUUkCIuv8pOzB2FUz5EiTHZpdeISfZ2Y99V9NNtZRU+4s4j4+wXIShaO5KZ0oRzB qdTZIIH6gan3ZxQsLrlZhZbChdyggsLOmx2cXHdot8MkP8idGt17Ath398Nhfgf+4LnC 9+mQZa87bmjlBnCI8CBbiVW/K6D1WjjQkd//ev6Ee4LutEjChpF12wTVjIwatdRTIp/a kIJPpkMVUg7dcZK7QdSDdW/ZzAfHD72CZ0EyQhg0DKkDHzkjCEqnK3a3yFkpkGwQh6jy V77QY09rKAsHZxMyft+HEQJtBMRtI1tsQcTErmA08WBwF+MyfFMIpG+RZy4hBBxyDhNk hObQ== 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=Y6IFZb9iTM4f2pWMPb5J661jTCMqYnTeYg7zRuPEpqLRZTattprgztRZT24HuyySWw DJyBKIGWGCyQgQ3MuuN6A6RjVoGKPDC3koG70CBF3IO86fAmfv24O1gpUWKwSFctTkNc Ekbxrk7QjDKdvKdh1WftyclSm4xUd7Ok+Wek9jiVf0ES+kAUftas57LoXHvYYLk9bDEP fLFcil9s+SCmk2JBHZ7dk7X4LRy8vFHAZcuPabd8Ob19yGtXJromDHNRjAH95qeZW4+B BOLyKQJVjPeSGTmhuqXiBAE/cKMcKE3SYQ0F9EHmChNdOqB2Tte3SOhhvck2KGp+EFyM 6j3A== X-Gm-Message-State: AOAM531rrMT4RhQ5EzX/RllxBbiXMMaf330l7GPQb6f0S2RWPZsCzSat J3BNNcWwY12an8eKI5irvFo2O9OT0ns= X-Google-Smtp-Source: ABdhPJykPWW6v4IoecSxgjiZgJVBFLgkTj+g/+FW9/jU/SbO1xhXTS6Z6QRL2wcCAIQR3KASAm9ISg== X-Received: by 2002:adf:f54e:: with SMTP id j14mr41443082wrp.91.1626863810035; Wed, 21 Jul 2021 03:36:50 -0700 (PDT) Received: from localhost.localdomain ([102.47.167.62]) by smtp.gmail.com with ESMTPSA id s24sm28854019wra.33.2021.07.21.03.36.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:36:49 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v2 4/5] docs/devel/tcg-plugins: added cores arg to cache plugin Date: Wed, 21 Jul 2021 12:36:10 +0200 Message-Id: <20210721103612.48844-5-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721103612.48844-1-ma.mandourr@gmail.com> References: <20210721103612.48844-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x431.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_?= =?utf-8?q?Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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:: will report the following:: - 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 misses, imiss rate + 0 996695 508 0.0510% 2642799 18617 0.7044% 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 optional: 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 = :code:`lru`) + + * arg="cores=N" + + Sets the number of cores for which we maintain separate icache and dcache. + (default: for linux-user, N = 1, for full system emulation: N = cores + available to guest) From patchwork Wed Jul 21 10:36:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahmoud Abumandour X-Patchwork-Id: 1508134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tyg2+odl; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVCC218gFz9sRR for ; Wed, 21 Jul 2021 20:54:38 +1000 (AEST) Received: from localhost ([::1]:45550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69s3-0005yr-UL for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2021 06:54:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m69aw-0004HU-9V for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:54 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:34407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m69au-0005AI-It for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:36:54 -0400 Received: by mail-wr1-x42e.google.com with SMTP id u1so1660153wrs.1 for ; Wed, 21 Jul 2021 03:36:52 -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=tyg2+odlUkGFwC0ZP/q86045/QyxIVt+Ew+MiLcj0svla7n0ESpHpBQv6tTVpXDVFT 1FrIR72ZSI2II3/DOeDGu9bkWFwqKaihKw61UVTHV9uPTz1rwUwBTVcbXJffYD6q3unR c6OZeHZiE67YLHH579g8svNx2u5MjWZRcdlOV9hDMuQn+QVe9xXEJxWytv7LkRzRG9UN BNYgt5bMfhZSSZgKaXfv+eUhbheyVFkIV+zW3Z76gKjor8hlURS5341oe4ve5UdWSkYW UYlRx0hKM2zdtS2XV+28rLRC7Yqh8KG1pfIJP9TsyHhYW4sTDjczeknSgAObUAE8pk7n X5/w== 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=olNYQ2PTi9RPNtsxs7l0iKHhahbmYEPpXK47XhK7cBW0yAmYE0E0DxDiCg3/Xy2Awn OAdCl+3Skvlo7V9vuWPZda77ABbcdV079w//cBx42YXuhnBny5wcChLlzwJJcUb/bsEZ gEviQaF5fBnaWyOPKZ8DYSYnqMIx9v/8H9Q5Lc+y8XexkHXRYuqr5gxAiqj1p0/XFh0r o4KT0xxXoDqPK67K5ntg2YTkhm+dWMkLRkftMJ3AyxLV7iB/9Ydt2JwBn6F/Yj7OhUZP wMSkpCQBKNwpL122yyRRwye2LXjoPat539H5fwC8Y4IjQGCHI5h0gbE8b30cxlcIBJ8i Hkfg== X-Gm-Message-State: AOAM533ZilooQquyup6mhiozoWhUpreWzs3eMyQBweWMeXX9vwvqQWa/ Mvu+oNVWDoJBEJX/p9pzRF7faaGoM50= X-Google-Smtp-Source: ABdhPJxZIfM7OdOixdjtBE2EDkxAQpB7kqOZmkOlBA3I6QUAsvOLIpVVpbqnvCnyKF5OXLk5qqUchg== X-Received: by 2002:a5d:6c6d:: with SMTP id r13mr41542664wrz.227.1626863811097; Wed, 21 Jul 2021 03:36:51 -0700 (PDT) Received: from localhost.localdomain ([102.47.167.62]) by smtp.gmail.com with ESMTPSA id s24sm28854019wra.33.2021.07.21.03.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:36:50 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v2 5/5] plugins/cache: Fixed "function decl. is not a prototype" warnings Date: Wed, 21 Jul 2021 12:36:11 +0200 Message-Id: <20210721103612.48844-6-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721103612.48844-1-ma.mandourr@gmail.com> References: <20210721103612.48844-1-ma.mandourr@gmail.com> MIME-Version: 1.0 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_?= =?utf-8?q?Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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) } } -static void log_stats() +static void log_stats(void) { int i, iters; @@ -559,7 +559,7 @@ static void log_stats() qemu_plugin_outs(rep->str); } -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); } -static void policy_init() +static void policy_init(void) { switch (policy) { case LRU: