From patchwork Thu Aug 11 06:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12941171 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 CB476C25B0C for ; Thu, 11 Aug 2022 06:26:56 +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=Ri9w7lzWSscyETgJv4oJ0kcrYcWK0u5mUJT3fUIvdME=; b=E+Z12wye8GhPXG ObLK/h9Mf7tedO02kl1ogupV/c3dY4f5CciyhrYMRIEFUU6NXcqsN+gMCDzNxd5flusBkhBHeElvP rBhd0rQRurpxsoMeSetFY9DyyBEuFE2RhBo+Eg+RCa3xmsSpvNcSlsUjQGeVU7Zg62P+4wT4STCxA ossnjOSBUv9uG2VUg7XCyMuvx5Hfrm5uhGlQSwDFxmo4TdRBTgiYDqap0Th3W7eWmEZk/Q2ozOyaB XlUGPdX3gPBG5AT0+LwqobR2lZOqIQECM03fU+5SaeGT1VlRSEShdhKmldMvgaQasK1DIzd/SSzQf /Q9s0Z5Eo7oi98pcNomQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM1d4-006qo9-H6; Thu, 11 Aug 2022 06:25:14 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM1d0-006qfZ-MA for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 06:25:12 +0000 Received: by mail-pl1-x62b.google.com with SMTP id g13so9238526plo.6 for ; Wed, 10 Aug 2022 23:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=i7Z567wnPQResZwkbA9bhahJXQAAUrN9ioX9I5+gOa4=; b=nX+ND60x40FmgG2d5K6hI0dekXkW2/oDgX4okhvQTMgu15F9ZM8UvkWWGylQTHKsck HwYD/bPW8C/qFaVLclZxyLNGxUp4oo0itYtSP708w+XR0+rESTu7qAIHem/6ZsyAaesc QyE90atwq7DhODul57hjUL/0XVermZHbit0SzsLgOvVz3Kpq4nFK9yjK81NFA1dF5Aak AZb7YQJhP7LKdyH4JV8g6FKvgSvjfCiJbkz/vZNCFFRZvXwl5wcjBCaV30pqNb01yZ7U x02bLwOm0qvrxmVR11kENbBczkL3TM4lCZQYAO4nuXakjx1IlmhQ1n5gzLPeVsUCtEP4 SIPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=i7Z567wnPQResZwkbA9bhahJXQAAUrN9ioX9I5+gOa4=; b=k8FWwJdYE9AM2m6vZlRGk8wGLEDsKjH6jNpdVZLk4t5gfoYjh7JVF+LG6lPkBIvn1D BR3Z/s/aCHjS9dH+QPD7Jn7tCS7SZpe4AoK8hwu+qSjri//tUpFbcK3kUZBjiXGXdCXj XNvsgayzWPOSMXauSL4/WT825M55nxZber5weP/+YTp2aNc6kuE9aAxKj9HQ9TRS9lQv jEWntGC6I8G3HsjQTaiX6Xxxjz0Mmn6dfcM6gkCXyv7HPgiR6txyjGJMcSva6aSCazcs KJEvjRpxxWOwco2wolp+LKRdm3DkSma/lpMeG3453kPcBmJX9h4YzHSEsxcRsXncEqnw HKMg== X-Gm-Message-State: ACgBeo3S6fVEXee90SwmwT0T8TMbuqQjsLCY7tG1BLQh/QoomJnmX+s+ v2ea3oCBl7ZYJqhqmPCDNM7MQQ== X-Google-Smtp-Source: AA6agR7kWfMikr56EQjLtH494GZ4vZcdlrk+19bGX1lm9Fgn/Kr6nBKF54L+RwLSBp0IHuQ9ygliaQ== X-Received: by 2002:a17:902:d64a:b0:16d:570c:9d7b with SMTP id y10-20020a170902d64a00b0016d570c9d7bmr30896287plh.1.1660199106391; Wed, 10 Aug 2022 23:25:06 -0700 (PDT) Received: from leoy-yangtze.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id o12-20020a17090a55cc00b001f506009036sm2766926pjm.49.2022.08.10.23.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 23:25:05 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , James Clark , Mike Leach , Kajol Jain , Ali Saidi , Adrian Hunter , "Gustavo A. R. Silva" , Anshuman Khandual , Ian Rogers , Like Xu , German Gomez , Timothy Hayes , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v6 00/15] perf c2c: Support data source and display for Arm64 Date: Thu, 11 Aug 2022 14:24:36 +0800 Message-Id: <20220811062451.435810-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220810_232510_786782_B8540224 X-CRM114-Status: GOOD ( 17.59 ) 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 has been rebased on the acme/perf/core branch with the latest commit b39c9e1b101d ("perf machine: Fix missing free of machine->kallsyms_filename"). To make building success, a compilation fixing commit [1] has been sent to LKML, this patch set is dependent on it. This patch set has been verified for both x86 perf memory events and Arm SPE events. [1] https://lore.kernel.org/lkml/20220811044341.426796-1-leo.yan@linaro.org/ Changes from v5: * Removed the patch "perf: Add SNOOP_PEER flag to perf mem data struct" (Arnaldo); * Removed the patch "perf arm-spe: Don't set data source if it's not a memory operation" which has been merged in the mainline kernel, so can dismiss merging conflict. * Rebased on the latest acme perf/core branch, no any code change compared to previous version. 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. Ali Saidi (2): perf tools: sync addition of PERF_MEM_SNOOPX_PEER perf arm-spe: Use SPE data source for neoverse cores Leo Yan (13): perf mem: Print snoop peer flag 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' 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 | 130 ++++- tools/perf/util/mem-events.c | 46 +- tools/perf/util/mem-events.h | 3 + 8 files changed, 547 insertions(+), 132 deletions(-)