From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no 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 09D66C388F2 for ; Fri, 6 Nov 2020 09:50:18 +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 8685920B80 for ; Fri, 6 Nov 2020 09:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jJSg07sJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cCtpPd9e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8685920B80 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=+3Jd8RugMH0fxT8Yc5F2hWETkuvcak1uhYRbqrkTQHc=; b=jJSg07sJkAIu6welVUo2isaNLR WVxQGsBWshSj1cB/IoCQCeueetxHuvg3H9e4kiLq22yf2ThExumhBNCLHwYnTtJ+nqlJgNwW6nFGN Na30ZHyZ7j0lzT7hDteNNYMQCLSjVQ6+XI/wC8J4rxi5Oyoc1fJTrbs/NI4dtmLOJqpp29nuPzbSf FDR178pboAx7v0HSb8UQIyI17V7N6lGfJc3tAPhlxcdOnIQbro1eV6Nztnb2RDp5WaMtg8DN8Y/0v MygY7RIN4rHg5Kd22qnoSFJIMXnptpv3cAdVnn146YGZIc1bXn/k+Jav2vU9fneSBFIuBKiqabni2 zQ+J2fkQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayNC-0007AU-N3; Fri, 06 Nov 2020 09:49:34 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayMv-00075p-81 for linux-arm-kernel@lists.infradead.org; Fri, 06 Nov 2020 09:49:18 +0000 Received: by mail-pg1-x541.google.com with SMTP id x13so528300pgp.7 for ; Fri, 06 Nov 2020 01:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7GGm+15NsiqV9cmWAtiFnC9DpN0irpfGqorANfORa8w=; b=cCtpPd9eTAkBXS66LMXjj1vCK6k9z2saUc6OR81LyOBukpfj4SC1ndwl38jB1S0ocq Lsm5WhNCicIXvfi59JT8dG5NpZw8fJyByPfQgyGWQv1Ow3vS8NX6w69YB9GNbU3hjg3w 9CE6f803psnTuWwv3vPuZ64ArVJtTit/qjNAexm8nBj8DjBRpd9IHm2PPF9b2swT7mwp gM3sqt/s94TwncILtebGy0e0pTCLRJGs290XFBmP5XLHuHW2W9Pm8HwbptLv+eaNwXE5 gVEeTuZZSL+x6px+MyaZaKczK4kOnOGJ8Y0amvpq70YNviNugOUTASjYHm4DN5VWfoVI D1hA== 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=7GGm+15NsiqV9cmWAtiFnC9DpN0irpfGqorANfORa8w=; b=Z9bGGdbZFXAxNiHY6hvoJqX40O5L49ugYgqJgMZeGyJXMX8VNpmR3LC34u4HbXG7kc Smt6YoDJXw16BUjSnx1NGBZ8Dx6ONMK9o7lGr9jX02U3XaC9jhBnX25lok8Can6H4bJJ prMx8pWExFmX3YToiIwFTMt4sKtNSas+ZYP8i3RlC91fxrsfKBPKyUbhNYJz+UvbEq0G CoWyMjBRlPnfho7ov91dDKXKhMiJi/w/wE9cW2tQJOaZ1kOO+UU0uncK9ibK3wiBGjJU xT0VwQ91QgLanuh4F/c0dZUOD1bhDpsEYTx5yktVt3sRXNUXur2ZLGzxhuoFa7ukv/8z JBnA== X-Gm-Message-State: AOAM533wYdeYxxQv7r/ArBFnfKRZsliJa5Iy3aSVMBU6FILTMl48Izeo SVzf29pcuOttWopPiOxfbr69Qg== X-Google-Smtp-Source: ABdhPJwMdvOOo2rzShbMP9JBXuA7TSBYMQkkfsSDx152a/Ptxms0KgTY1vugZdWx07ThAM32BHRJ9g== X-Received: by 2002:a17:90a:c381:: with SMTP id h1mr1699710pjt.2.1604656153991; Fri, 06 Nov 2020 01:49:13 -0800 (PST) Received: from localhost ([2400:8904::f03c:91ff:fe8a:adf7]) by smtp.gmail.com with ESMTPSA id kb12sm1784173pjb.2.2020.11.06.01.49.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Nov 2020 01:49:12 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , John Garry , Will Deacon , Mathieu Poirier , Adrian Hunter , Andi Kleen , Kemeng Shi , Sergey Senozhatsky , Al Grant , James Clark , Wei Li , Andre Przywara , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 0/9] perf mem/c2c: Support AUX trace Date: Fri, 6 Nov 2020 17:48:44 +0800 Message-Id: <20201106094853.21082-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-20201106_044917_370206_089BAF95 X-CRM114-Status: GOOD ( 18.66 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series is v4 for support perf mem/c2c AUX trace. Comparing to patch set v3, this patch set adds back the patch 06/09 for introducing the itrace option '-M', this allows to synthenize memory event from the AUX trace data. Since perf mem/c2c tools are focus on memory profiling, this patch set makes itrace memory event as default for perf mem/c2c, the tool will tell AUX trace decoder that it is _ONLY_ interested in memory event rather than other itrace events. So patches 07, 08 have updated 'itrace_synth_opts' for this. This patch has dropped the memory type 'ldst' and keeps to use the old types 'load' and 'store', if user passes the type 'load,store', the tool can automatically use PERF_MEM_EVENTS__LOAD_STORE event if arch supports it, otherwise, rolls back to enable both LOAD and STORE events. So we don't need to do any change for tool's usage. This patch set has been applied clearly on the perf/core branch with the latest commit 7b3bcedf5ee5 ("perf scripting python: Avoid declaring function pointers with a visibility attribute"). This patch set has been verified on both x86 and Arm64. On x86, below commands have been tested: # perf c2c record -- ~/false_sharing.exe 2 # perf c2c record -e ldlat-loads -- ~/false_sharing.exe 2 # perf c2c record -e ldlat-stores -- ~/false_sharing.exe 2 # perf mem record -- ~/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 load,store -- ~/false_sharing.exe 2 # 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 -- ~/false_sharing.exe 2 # 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 -- ~/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 load,store -- ~/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 Changes from v3: * Added back the patch 06/09 for introducing the itrace option '-M' (Jiri); * Added 'itrace_synth_opts' for memory event (Jiri); * Dropped type 'ldst' so don't change any usages for tools (Ian); * Dropped the patch "perf mem: Return NULL for event 'ldst' on PowerPC" due type 'ldst' is not added anymore (Ian); * Added patch 04/09 "perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE", so can convert the load/store requests to event PERF_MEM_EVENTS__LOAD_STORE (James Clark). 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 c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE perf mem: Only initialize memory event for recording perf auxtrace: Add itrace option '-M' for memory events perf mem: Support AUX trace perf c2c: Support AUX trace perf mem: Support Arm SPE events tools/perf/Documentation/itrace.txt | 1 + tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/arm64/util/mem-events.c | 37 ++++++++++++++++ tools/perf/builtin-c2c.c | 39 ++++++++++++++--- tools/perf/builtin-mem.c | 56 +++++++++++++++++++------ tools/perf/util/auxtrace.c | 4 ++ tools/perf/util/auxtrace.h | 2 + tools/perf/util/mem-events.c | 45 +++++++++++++++----- tools/perf/util/mem-events.h | 3 +- 9 files changed, 158 insertions(+), 31 deletions(-) create mode 100644 tools/perf/arch/arm64/util/mem-events.c -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel