From patchwork Wed Oct 28 06:38:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11862517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5121C4363A for ; Wed, 28 Oct 2020 06:39:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3790F22241 for ; Wed, 28 Oct 2020 06:39:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l5URhJvr"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ntnVw4zW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3790F22241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=ltbDxOJA0Pw3Kdy6TvRMjL1+N1wQVaW7ahmOX55kGSg=; b=l5URhJvrmrRsLtB5WU/pqYozMy Tf3woSho2AD/dEndbcKRf8d+3lBQKOCCpei53qnspyUER+2jxIB4RWaBUQHON3Fj61B6dhF/x4/vl QAxUx3bfKGS0lJMhltuXMkUjfphfNKgCxF7dIvYP6wjPwzD0WmchPSn+A65D58liefvTBkd8W23lr qwMXMX4doILEZsNVqCriWEqQO0jQ7NWHsHxC/lFK7tCgOUGIPKlDLuvp7eLqIVe299OWunvgIPPWR 7gAQ45+8h0uBO7TFz6DjA0fm0Yr+Da2jAWxew+G897dW5npajdBLSofK7u8NvPRJcAYRcZxDZHUTi nOBNmULw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXf6Q-0006TA-06; Wed, 28 Oct 2020 06:38:34 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXf6K-0006Rq-C9 for linux-arm-kernel@lists.infradead.org; Wed, 28 Oct 2020 06:38:31 +0000 Received: by mail-pf1-x444.google.com with SMTP id e7so2338528pfn.12 for ; Tue, 27 Oct 2020 23:38:26 -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; bh=1cQOz6xe20uUsRkiyAuJXh3GxeGLZykdgg7FMJb+9TM=; b=ntnVw4zWPTSF52CfSWIdiqgEPO4CfxGZ21R82hCOg03zVqyRyFeEKdVTSJzffVd38J kVwbwfRz3Q0kzb+9YLMZWcZLV7nxrFTQNomneeaWtckMrwU1qIBKgzTz6rvfGee4e88u liB2uR5zLpgl6RGDJEGlLZVI5VeNr/QiwgqlHtPQZOJnH+2gsYaYvf0Mb5t/aLOGsPlp vFZvPF8qK3teef8a+A2x1jwFDKTZiKufP2yl9Ba1oKCxWFUUAT5J6tjBwQcjYmUABH40 aAuBTPJgzP9BGUVuurvbNmJelWeXxahqSclq0PmKdW1SugPDCDWak4v5iExHv8YGpAKf 7ncA== 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; bh=1cQOz6xe20uUsRkiyAuJXh3GxeGLZykdgg7FMJb+9TM=; b=OTTypu7F73p8LuI7iPwAqoosB8CjueFP/x/G86n76NHVwlzqVteTDvZr75xHL27fBH uYw4DFfISBUpAnlmnfWQ8Zy+lJKll8NDmzNSFpyX16F5UE5C+7Uj2JRwZBLJIf5GpoE/ 4v/r0jNY3gzlGWCy3szb1iKiVjBYIO791N3x+q6nnfoA1bA77gBdGvWBBosBRSdv0jQ0 DchWJP5/7FsJyZGTpH0i6JgbJOBin7PK8CbBf4YTkZmWuccKWIzlfHQhAbEfgfBjr5uU /ElCv0xhBCPgeWx37SrUil0CtrHMzxdJRKUAz3WovmLaffKBvxBbFpjt2FV8Iqj4tIRI mnAA== X-Gm-Message-State: AOAM533/U4JG67m/wdLoYLfZbLCpBn3Xhs7AFf679Hg41Jx6kIj+m8Ah 09++CIZOIZBEZvfsp0iy4qBy6Fg+prlCtl5B X-Google-Smtp-Source: ABdhPJzSSQLsObq9R6Qna2EWklpUp7kMkjkQsi/Stm0Xg/CGBjSQq8PXNnA/hGApdSSBbqZLrbrCBw== X-Received: by 2002:aa7:85c3:0:b029:156:78e8:1455 with SMTP id z3-20020aa785c30000b029015678e81455mr5261262pfn.68.1603867104520; Tue, 27 Oct 2020 23:38:24 -0700 (PDT) Received: from localhost ([2600:3c01::f03c:91ff:fe8a:bb03]) by smtp.gmail.com with ESMTPSA id f4sm4451655pfc.63.2020.10.27.23.38.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Oct 2020 23:38:23 -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 , Mathieu Poirier , Kemeng Shi , "Naveen N. Rao" , Ian Rogers , Al Grant , James Clark , Wei Li , =?utf-8?q?Andr=C3=A9_Przywara?= , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 0/9] perf mem/c2c: Support AUX trace Date: Wed, 28 Oct 2020 14:38:04 +0800 Message-Id: <20201028063813.8562-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_023828_711437_8BB02E3A X-CRM114-Status: GOOD ( 17.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The patch set v2 [1] mixed the patches for support perf mem/c2c AUX trace and for enabling Arm SPE's memory event. To make easier reviewing, this patch set extracts the changes for perf mem/c2c AUX trace. Patches 01, 02, 03 extend to support more flexible memory event name and introduce a new event type 'ldst' (besides the existed types 'load' and 'store'). Patch 04 is a minor refactoring to initailize memory event for recording but not for reporting. Patches 05, 06 are to support AUX trace for "perf mem" and "perf c2c" tools. Patch 07 enabled SPE memory events for Arm64 arch; patch 08 fixes the memory event name issue on PowerPC. Patch 09 is to update documentation to reflect the latest changes. This patch set has been applied clearly on the perf/core branch with the latest commit 7cf726a59435 ("Merge tag 'linux-kselftest-kunit-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest"). This patch set has been verified on x86 and Arm64. On x86, below commands have been tested: # perf c2c record -e ldlat-loads -- ~/false_sharing.exe 2 # perf c2c record -e ldlat-stores -- ~/false_sharing.exe 2 # perf mem record -t load -- ~/false_sharing.exe 2 # perf mem record -t store -- ~/false_sharing.exe 2 # perf mem record -t ldst -- ~/false_sharing.exe 2 `-> report failure due the type 'ldst' is not supported on x86 # perf mem record -e ldlat-loads -- ~/false_sharing.exe 2 # perf mem record -e ldlat-stores -- ~/false_sharing.exe 2 On Arm64, below commands have been tested: # perf c2c record -e spe-load -- ~/false_sharing.exe 2 # perf c2c record -e spe-store -- ~/false_sharing.exe 2 # perf c2c record -e spe-ldst -- ~/false_sharing.exe 2 # perf mem record -t load -- ~/false_sharing.exe 2 # perf mem record -t store -- ~/false_sharing.exe 2 # perf mem record -t ldst -- ~/false_sharing.exe 2 # perf mem record -e spe-load -- ~/false_sharing.exe 2 # perf mem record -e spe-store -- ~/false_sharing.exe 2 # perf mem record -e spe-ldst -- ~/false_sharing.exe 2 [1] https://lore.kernel.org/patchwork/cover/1298085/ Leo Yan (9): perf mem: Search event name with more flexible path perf mem: Introduce weak function perf_mem_events__ptr() perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE perf mem: Only initialize memory event for recording perf mem: Support AUX trace perf c2c: Support AUX trace perf mem: Support Arm SPE events perf mem: Return NULL for event 'ldst' on PowerPC perf mem: Document event type 'ldst' Changes from v2: * Patch 02 went back to use loops with PERF_MEM_EVENTS__MAX (Jiri); * Patch 06 for "perf c2c" AUX trace is supported; * Patch 08 for fixing memory event name on PowerPC. Changes from v1: * Refined patch 02 to use perf_mem_events__ptr() to return event pointer and check if pointer is NULL, and remove the condition checking for PERF_MEM_EVENTS__MAX; (James Clark) * Added new itrace option 'M' for memory events; * Added patch 14 to update documentation. tools/perf/Documentation/perf-mem.txt | 6 ++- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/arm64/util/mem-events.c | 37 +++++++++++++++++ tools/perf/arch/powerpc/util/mem-events.c | 6 ++- tools/perf/builtin-c2c.c | 22 +++++++--- tools/perf/builtin-mem.c | 49 ++++++++++++++++------- tools/perf/util/mem-events.c | 45 ++++++++++++++++----- tools/perf/util/mem-events.h | 3 +- 8 files changed, 133 insertions(+), 37 deletions(-) create mode 100644 tools/perf/arch/arm64/util/mem-events.c