From patchwork Fri Apr 8 19:53:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ali Saidi X-Patchwork-Id: 12807150 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 BA3F7C433EF for ; Fri, 8 Apr 2022 19:55:42 +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=B2nWdPl47UISVpGTlUd31El6HEI/qx2KzdgfGHb7eOc=; b=IkgyG/KxF1uGwa OuXCRsluXr08Ds9U22uVR3RuXwumOCv/DvjpcxFl3sHKAa5hYPusIXYpwI8ZX3mwQ9oXJbUlmhEXG BThJUn5VVet8eJSdwdTGe436RJ25S0+rH9JO/Ulp+T3Ft0u2J0Jae21PiWl6zlsBi8HHtyATiUaTO F7WvQTFTDn44bR8bjTGdGUZK26kWqdjBR90JZ2GJqlSiJAOJVePAGa9NisJghKsxoJmBbncgpDKoX B1tIcgQ3MdFAzP+NpgALYtEWbBCCozSwdtq/1AxDeyj8yhd0vlVOlRQb5rnhuNXvoyTiwbAdd7mQK UotvTaF7us43mlqtIImw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncugg-0015ym-6B; Fri, 08 Apr 2022 19:54:30 +0000 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncugL-0015rN-DL for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 19:54:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1649447649; x=1680983649; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XbbHkB6cXBfuE9MzIxi7zYV+cwhUy0oQcVZcvwc+AYE=; b=NpErk+OQI7vQ/Qs6+5DjiRT/SiGGsZ/4/uyo4GUCEkSsWCd/UAwDJ9zP mqmjufPx8qKSVGTq9141FFkgo9VmFX5yytxLOpTRNfVsp8LSlPnMWvF/4 Nu79vv2MkLnJOBjnWoTTeUSdNdci8ZiVJiHtUri8eJ6UZ2EWiae1qDNl9 c=; X-IronPort-AV: E=Sophos;i="5.90,245,1643673600"; d="scan'208";a="187479247" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1d-10222bbc.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP; 08 Apr 2022 19:54:03 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-10222bbc.us-east-1.amazon.com (Postfix) with ESMTPS id AD86E1A0BFE; Fri, 8 Apr 2022 19:53:57 +0000 (UTC) Received: from EX13D02UWB002.ant.amazon.com (10.43.161.160) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 8 Apr 2022 19:53:56 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D02UWB002.ant.amazon.com (10.43.161.160) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 8 Apr 2022 19:53:56 +0000 Received: from dev-dsk-alisaidi-1d-b9a0e636.us-east-1.amazon.com (172.19.181.128) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.32 via Frontend Transport; Fri, 8 Apr 2022 19:53:56 +0000 Received: by dev-dsk-alisaidi-1d-b9a0e636.us-east-1.amazon.com (Postfix, from userid 5131138) id 71D592C3F; Fri, 8 Apr 2022 19:53:55 +0000 (UTC) From: Ali Saidi To: , , , , , CC: , , , , , , , , , , , , , , , Subject: [PATCH v4 0/4] perf: arm-spe: Decode SPE source and use for perf c2c Date: Fri, 8 Apr 2022 19:53:39 +0000 Message-ID: <20220408195344.32764-1-alisaidi@amazon.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: Bulk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_125409_649979_D5BC5FB6 X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 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 When synthesizing data from SPE, augment the type with source information for Arm Neoverse cores so we can detect situtions like cache line contention and transfers on Arm platforms. This changes enables the expected behavior of perf c2c on a system with SPE where lines that are shared among multiple cores show up in perf c2c output. These changes switch to use mem_lvl_num to encode the level information instead of mem_lvl which is being deprecated, but I haven't found other users of mem_lvl_num. Changes in v5: * Add a new snooping type to disambiguate cache-to-cache transfers where we don't know if the data is clean or dirty. * Set snoop flags on all the data-source cases * Special case stores as we have no information on them Changes in v4: * Bring-in the kernel's arch/arm64/include/asm/cputype.h into tools/ * Add neoverse-v1 to the neoverse cores list Ali Saidi (4): tools: arm64: Import cputype.h perf arm-spe: Use SPE data source for neoverse cores perf mem: Support mem_lvl_num in c2c command perf mem: Support HITM for when mem_lvl_num is any tools/arch/arm64/include/asm/cputype.h | 258 ++++++++++++++++++ .../util/arm-spe-decoder/arm-spe-decoder.c | 1 + .../util/arm-spe-decoder/arm-spe-decoder.h | 12 + tools/perf/util/arm-spe.c | 110 +++++++- tools/perf/util/mem-events.c | 20 +- 5 files changed, 383 insertions(+), 18 deletions(-) create mode 100644 tools/arch/arm64/include/asm/cputype.h