From patchwork Sat Jun 4 04:28:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12869557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8DC39C43334 for ; Sat, 4 Jun 2022 04:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1BvH6EvYEgJjt1LQ7owqTX19vDKk+C+YRCDv0DhB1w0=; b=2/LOh+LPrx0Dp+ niDYk+UMRTE9Rn3vLagYolClswXx3petlvhA1SiV2zp9nI2jG3yBNbKYFv5WpSPcEU7JzjQVy9H7N lWJa8RD20nQcHLN4lIP5XuEHUArKGMhoYKHiljOoYznhPOlQ6XgzFwZdAe8gwA3aJ5ZCiokvjSJ7a 4nTwQEPrHAiT99QhiG5XRuXC+/32iUvwhnXWj75C283C83up0s1ww7g8xJyxtk9VmhnpkDSYKuB7x nzZ0pMi1W+SgnrS47JfGt55eqv4WV4dmB3g8YeHQ48mflL4rLHXCeSvcC7sgVqm8zDcYR7I1ePEci wI1H3zeEWR2JILobnS/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxLP9-00ADuY-5T; Sat, 04 Jun 2022 04:28:51 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxLP4-00ADst-Vx for linux-arm-kernel@lists.infradead.org; Sat, 04 Jun 2022 04:28:48 +0000 Received: by mail-pj1-x1034.google.com with SMTP id q12-20020a17090a304c00b001e2d4fb0eb4so13523332pjl.4 for ; Fri, 03 Jun 2022 21:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Yn5/ZDP8Cojank8hFfjZKa0tb2ssK51DrACpaq53qsA=; b=pmiYleJAyY4Pmhe9IA+istalMQQ2fNuvuI4ulBeYvwEcfBwtO0Z4SHYElxtwDwr87Z wRAoWnYOjED4BtdGz0S1GRPVaXEW7wyY7nopMyi7LGY9TnS4u74WaSLnb1/ojgjxEk0k Z4EVoBe4CpcsBs3P32Qc3sp/80vs9wbz3Pb4s+BK+w5jMb4OTWtrAXRfX9zMs1D5bJeL G/9vj0yOXcEBtga+JtP/gnKCOFPO0iO2qNrFrioBD/IFJj5+lXnthTu+Iq4kJUQ2syge yWiu1/0yswEhGPM/E8zyJk1ZbwVelL1FoWkBgJ6ddpfZ8AtfJRVtAvR2QSsnOKiwqY6N 4gIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Yn5/ZDP8Cojank8hFfjZKa0tb2ssK51DrACpaq53qsA=; b=YdCghkgOIOUf/Cs6PROdrdF3/juPOVHGTIEV1rKFQJEs75jP4poelNhrJUFII2RvzC Md48QTYPuEmPAoUUARmp6jjqvBwzlQAP3p8TA2noIRkfxNlTI1hc48dapcLu2Mmk0btQ J9m/px7TGOV73pgfRtBepCoH0sV+dTGMMaJc5IzVylMLzZ4hj5Amej7/ZI2Tl8z5EkXd 5HjVlddYjK/65oxomDkSaroAQpHQ05VbEoKu6fT7LQhoDnZAjxCFiuLxfrLkjvUZ7IqC KDvYq0WCWPomf5TA8C48Q8VJxv7yNaNs0v3yittT9832zG296qjIhKnvS8HXJk5+l5tX zemA== X-Gm-Message-State: AOAM532sIotGUgY4vD2XQruLuvE0SEpwr4GgpQHgJ4DNCGti/guElpDc f6iYqWumMFvU+7TB7WPR8pyanQ== X-Google-Smtp-Source: ABdhPJwxyyu+5EskOg5GTwWkuWqJPxuVx7mgJG0Eh2CnxWlooMI7n0I1FYZXm4li0cV/Bxkkv2RUrA== X-Received: by 2002:a17:903:290:b0:15c:1c87:e66c with SMTP id j16-20020a170903029000b0015c1c87e66cmr13300666plr.61.1654316921960; Fri, 03 Jun 2022 21:28:41 -0700 (PDT) Received: from leo-build-box.lan (ec2-54-67-95-58.us-west-1.compute.amazonaws.com. [54.67.95.58]) by smtp.gmail.com with ESMTPSA id w24-20020a1709027b9800b00163d4c3ffabsm6152916pll.304.2022.06.03.21.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 21:28:41 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Ian Rogers , John Garry , Will Deacon , James Clark , German Gomez , Ali Saidi , Joe Mario , Adam Li , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v5 00/17] perf c2c: Support data source and display for Arm64 Date: Sat, 4 Jun 2022 12:28:03 +0800 Message-Id: <20220604042820.2270916-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_212847_083993_85EC305B X-CRM114-Status: GOOD ( 16.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Arm64 Neoverse CPUs supports data source in Arm SPE trace, this allows us to detect cache line contention and transfers. This patch set includes Ali's patch set v9 "perf: arm-spe: Decode SPE source and use for perf c2c" [1] and rebased on the latest perf core banch with latest commit 1bcca2b1bd67 ("perf vendor events intel: Update metrics for Alderlake"). Patches 01-05 comes from Ali's patch set to support data source for Arm SPE for neoverse cores. Patches 06-17 are patches from patch set v4 for support perf c2c peer display for Arm64 [2]. This patch set has been verified for both x86 perf memory events and Arm SPE events. [1] https://lore.kernel.org/lkml/20220517020326.18580-1-alisaidi@amazon.com/ [2] https://lore.kernel.org/lkml/20220530114036.3225544-1-leo.yan@linaro.org/ Changes from v4: * Included Ali's patch set for adding data source in Arm SPE samples; * Added Ian's ACK and Ali's review and test tags; * Update document for the default peer dispaly for Arm64 (Ali). Changes from v3: * Changed to display remote and local peer accesses (Joe); * Fixed the usage info for display types (Joe); * Do not display HITM dimensions when use 'peer' display, and HITM display doesn't show any 'peer' dimensions (James); * Split to smaller patches for adding dimensions of peer operations; * Updated documentation to reflect the latest GUI and stdio. Changes from v2: * Updated patch 04 to account metrics for both cache level and ld_peer for PEER flag; * Updated document for metric 'rmt_hit' which is accounted for all remote accesses (include remote DRAM and any upward caches). Changes from v1: * Updated patches 01, 02 and 03 to support 'N/A' metrics for store operations, so can align with the patch set [1] for store samples. Ali Saidi (3): perf: Add SNOOP_PEER flag to perf mem data struct perf tools: sync addition of PERF_MEM_SNOOPX_PEER perf arm-spe: Use SPE data source for neoverse cores Leo Yan (14): perf mem: Print snoop peer flag perf arm-spe: Don't set data source if it's not a memory operation perf mem: Add statistics for peer snooping perf c2c: Output statistics for peer snooping perf c2c: Add dimensions for peer load operations perf c2c: Add dimensions of peer metrics for cache line view perf c2c: Add mean dimensions for peer operations perf c2c: Use explicit names for display macros perf c2c: Rename dimension from 'percent_hitm' to 'percent_costly_snoop' perf c2c: Refactor node header perf c2c: Refactor display string perf c2c: Sort on peer snooping for load operations perf c2c: Use 'peer' as default display for Arm64 perf c2c: Update documentation for new display option 'peer' include/uapi/linux/perf_event.h | 2 +- tools/include/uapi/linux/perf_event.h | 2 +- tools/perf/Documentation/perf-c2c.txt | 31 +- tools/perf/builtin-c2c.c | 454 ++++++++++++++---- .../util/arm-spe-decoder/arm-spe-decoder.c | 1 + .../util/arm-spe-decoder/arm-spe-decoder.h | 12 + tools/perf/util/arm-spe.c | 140 +++++- tools/perf/util/mem-events.c | 46 +- tools/perf/util/mem-events.h | 3 + 9 files changed, 550 insertions(+), 141 deletions(-)