From nobody Sat May 18 21:00:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1624858785; cv=none; d=zohomail.com; s=zohoarc; b=NLsZeIaaWGepParMl1DoIdF69QPRrw0TmSnkxT4d7OweorR9XYBpdcpuIWs3WlOj5CRec/H1wC7w6B7i9ZVIf87hEKS5/tH1NcsM1YKVCVmoQEgZ7MVhQE2fa2nhc+u16AwQ3I+S2F1Lf8GQFMdJVW7yCGCK9eKgPbbUBsV3fhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624858785; h=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=oxZIdLS55HsejJxbFM1hVlrSvIZofZOHWZM/v5dkC+Q=; b=K0FaY0kN3qkUo9jLiytkktE360Qlu4aYz0IWwfZcFgfXOicXVDtO6nIKDpjishxfTy4A++NQf9pY4Ru4+U4iKOxcuwAzy4i1fI0VqIcvTBVEXZop872pfcMi1fqIxq6ZnonP8/1AkmMdPSP5u98wajrx5xWEg+Kht/dM4eju3BI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624858785548430.2649029331536; Sun, 27 Jun 2021 22:39:45 -0700 (PDT) Received: from localhost ([::1]:56606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxjzj-00017O-B0 for importer@patchew.org; Mon, 28 Jun 2021 01:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxjyQ-0000RH-3w for qemu-devel@nongnu.org; Mon, 28 Jun 2021 01:38:22 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:51875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lxjyN-0006sW-Cg for qemu-devel@nongnu.org; Mon, 28 Jun 2021 01:38:20 -0400 Received: by mail-wm1-x330.google.com with SMTP id r3so5963215wmq.1 for ; Sun, 27 Jun 2021 22:38:18 -0700 (PDT) Received: from localhost.localdomain ([197.61.111.52]) by smtp.gmail.com with ESMTPSA id 22sm12127084wmi.4.2021.06.27.22.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 22:38:16 -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=oxZIdLS55HsejJxbFM1hVlrSvIZofZOHWZM/v5dkC+Q=; b=Fz/U94zc6jeJjhMSs8sZ6xK2u83DdJNFj7qlCjvk60D7X7mSm1NLD1hlexWsRM11gI ZO4zhOV78E0GTFohjlAptB8Ecd2UspVee3R87RqM1ByJKIzEZOecZzRJ3c+6G7/OfLnH y0gQj4UWsqtWSxf2Zl0IJLbK88dgjZuisjrIOAS121Umkf1GPDkc9BanueJ6uBotFrNk cv0c7ZXfwC3k1KKKMR0FFosffIASWI9IoyWg7e/Mu/4tmzcermziDy4iBYZ5DowA+sJx sLbAZUcFQRHFg5c6h9BRGo0zsPEKTQm+fIha+i+fuWLw4COu5V5zlYbQaqAnasSPKA+c p2mA== 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=oxZIdLS55HsejJxbFM1hVlrSvIZofZOHWZM/v5dkC+Q=; b=LBg5qhU96GDAIQgMSUmjo6US5UEtjvwCL3xAK+yrCzNSd7n112nYXRpqSv0KstnQoE yOaPo4nj2SIOUjLrddpyJKwWE9p3OwoGVzb446W7qmzTAqkWuSxxDO7Ax8OGPPA1ys8M GnxmKAN79uSMPnQeTIevLK9Cc2yZjGnDh8hNIgb5uZa6m4y6/yktyZI3ksStS+b5dgd5 PM7WWy6YmUrFDjmNcppBa9srUJH2nhkCDrAKVkA5mJM+OJkr02G/5SkCABbgP7NO3IKf Hivx6PA4nPw4AvANX0u+RUzieeBA1RP2babxN5vqJIf9L5+zv57MYFopimKabVa1JxFY P5vQ== X-Gm-Message-State: AOAM5335Jb+3WHCexxkbpve/c0GCn6fESWzXl+PIZ0B0buLZNEjrcypq sdPj4nLnEN6gP91w7qN+3ugXODPvTdoPsQ== X-Google-Smtp-Source: ABdhPJzLy6+u3VGoDveG8+q8vRhJcZGCs3hbKYSSpeMBKXikCfiKWXzuupvnlQO2srSkLagDVJ2MJg== X-Received: by 2002:a1c:dd07:: with SMTP id u7mr3382186wmg.47.1624858696979; Sun, 27 Jun 2021 22:38:16 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v5] docs/devel: Added cache plugin to the plugins docs Date: Mon, 28 Jun 2021 07:38:08 +0200 Message-Id: <20210628053808.17422-1-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210623125458.450462-5-ma.mandourr@gmail.com> References: <20210623125458.450462-5-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::330; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x330.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 , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- v4 -> v5: Fixed the illustrated command since it has path problems... docs/devel/tcg-plugins.rst | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 18c6581d85..595b8e0ea4 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -319,3 +319,62 @@ the user to see what hardware is accessed how often. I= t has a number of options: off:0000001c, 1, 2 off:00000020, 1, 2 ... + +- contrib/plugins/cache + +Cache modelling plugin that measures the performance of a given cache +configuration when a given working set is run:: + + ./x86_64-linux-user/qemu-x86_64 -plugin ./contrib/plugins/libcache.so \ + -d plugin -D cache.log ./tests/tcg/x86_64-linux-user/float_convs + +will report the following:: + + Data accesses: 996479, Misses: 507 + Miss rate: 0.050879% + + Instruction accesses: 2641737, Misses: 18617 + Miss rate: 0.704726% + + address, data misses, instruction + 0x424f1e (_int_malloc), 109, movq %rax, 8(%rcx) + 0x41f395 (_IO_default_xsputn), 49, movb %dl, (%rdi, %rax) + 0x42584d (ptmalloc_init.part.0), 33, movaps %xmm0, (%rax) + 0x454d48 (__tunables_init), 20, cmpb $0, (%r8) + ... + + address, fetch misses, instruction + 0x4160a0 (__vfprintf_internal), 744, movl $1, %ebx + 0x41f0a0 (_IO_setb), 744, endbr64 + 0x415882 (__vfprintf_internal), 744, movq %r12, %rdi + 0x4268a0 (__malloc), 696, andq $0xfffffffffffffff0, %rax + ... + +The plugin has a number of arguments, all of them are optional: + + * arg=3D"limit=3DN" + + Print top N icache and dcache thrashing instructions along with their + address, number of misses, and its disassembly. (default: 32) + + * arg=3D"icachesize=3DN" + * arg=3D"iblksize=3DB" + * arg=3D"iassoc=3DA" + + Instruction cache configuration arguments. They specify the cache size, = block + size, and associativity of the instruction cache, respectively. + (default: N =3D 16384, B =3D 64, A =3D 8) + + * arg=3D"dcachesize=3DN" + * arg=3D"dblksize=3DB" + * arg=3D"dassoc=3DA" + + Data cache configuration arguments. They specify the cache size, block s= ize, + and associativity of the data cache, respectively. + (default: N =3D 16384, B =3D 64, A =3D 8) + + * arg=3D"evict=3DPOLICY" + + 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`) --=20 2.25.1