Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4187716pxf; Tue, 23 Mar 2021 05:08:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmNb6XQS0MYJZjVkFIuvi5FIq0L8/6m53LfzkqWvlK8JXN8DQH2pFBnIw2Vkw7DGq1uPe2 X-Received: by 2002:a05:6402:4241:: with SMTP id g1mr4288343edb.331.1616501336064; Tue, 23 Mar 2021 05:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616501336; cv=none; d=google.com; s=arc-20160816; b=dxdQ4GBe5QeydojM5xH4q+sybKeaKTNuzcLQdUCDR1eWSx5O+V/lL+0pHVyRQ6JGQ5 xMiU9wHrgc5D5QHREWg78lnLLIbRTh9/L95RCEK3IBNDYp7AKBUzcfhRS8aFsMrcWB6B vCuFnyDpq1+q1AsL4MCbyrZgdyedKcIDfnhYaYT910rzPLL0jrZfmUj7EuwG0YEDiR6n 2wGDHqoE4TAayVgxOpe7RJZJKs9+jkctjBTRycnR4QtFu3JSorOp2hN6TLDyy3RSxbSK Pc5eFWEx4gdadxnv/trnfgvO16Wa3ccNouOvzItgULjeWOs4axEOBLQoksNwnKGV+TYa w9xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yAV9TJ6jK5KxYD1XINGzxRdO+jP3PiB57eZm/b9ZyVs=; b=lVpDJURNXJKRTtMqcf5lXROT7kKQhtlVHst0nh/qsxYqGSgeY9CUX4A/IyDMu50uen LexXzoHA+Zh/0CxjZcnXqTdx0TN3ny5rH/uJ2Q089l65DtaTSGmrXn++eL9Y7VNhhDXa vDSGm52IBTPfZnyOuqDF4CkKTHoamzr6TbhNiFgNl4zJTiGM/UhtfDLlS07tLg1GfSXz 3Usu5fJ6n1e1lp7av64TDZdZZm8xnbN4PNI1kJNuA2QcZe3JilH+wXbxq/dRSgpPlE6f WCSm2rJYNJQ/6Dx/JJNrCsRQexaWZn6hVfTzUcvZ88nnNTcVjvBCu9bthTA0VoNvikvL CCjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si12930180eda.91.2021.03.23.05.08.31; Tue, 23 Mar 2021 05:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230374AbhCWMHm (ORCPT + 99 others); Tue, 23 Mar 2021 08:07:42 -0400 Received: from foss.arm.com ([217.140.110.172]:45072 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbhCWMHS (ORCPT ); Tue, 23 Mar 2021 08:07:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7051D106F; Tue, 23 Mar 2021 05:07:17 -0700 (PDT) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 04D613F719; Tue, 23 Mar 2021 05:07:15 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, anshuman.khandual@arm.com, maz@kernel.org, catalin.marinas@arm.com, Suzuki K Poulose , Peter Zijlstra Subject: [PATCH v5 04/19] perf: aux: Add CoreSight PMU buffer formats Date: Tue, 23 Mar 2021 12:06:32 +0000 Message-Id: <20210323120647.454211-5-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20210323120647.454211-1-suzuki.poulose@arm.com> References: <20210323120647.454211-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CoreSight PMU supports aux-buffer for the ETM tracing. The trace generated by the ETM (associated with individual CPUs, like Intel PT) is captured by a separate IP (CoreSight TMC-ETR/ETF until now). The TMC-ETR applies formatting of the raw ETM trace data, as it can collect traces from multiple ETMs, with the TraceID to indicate the source of a given trace packet. Arm Trace Buffer Extension is new "sink" IP, attached to individual CPUs and thus do not provide additional formatting, like TMC-ETR. Additionally, a system could have both TRBE *and* TMC-ETR for the trace collection. e.g, TMC-ETR could be used as a single trace buffer to collect data from multiple ETMs to correlate the traces from different CPUs. It is possible to have a perf session where some events end up collecting the trace in TMC-ETR while the others in TRBE. Thus we need a way to identify the type of the trace for each AUX record. Define the trace formats exported by the CoreSight PMU. We don't define the flags following the "ETM" as this information is available to the user when issuing the session. What is missing is the additional formatting applied by the "sink" which is decided at the runtime and the user may not have a control on. So we define : - CORESIGHT format (indicates the Frame format) - RAW format (indicates the format of the source) The default value is CORESIGHT format for all the records (i,e == 0). Add the RAW format for others that use raw format. Cc: Peter Zijlstra Cc: Mike Leach Cc: Mathieu Poirier Cc: Leo Yan Cc: Anshuman Khandual Reviewed-by: Mike Leach Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- include/uapi/linux/perf_event.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index f006eeab6f0e..63971eaef127 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h @@ -1162,6 +1162,10 @@ enum perf_callchain_context { #define PERF_AUX_FLAG_COLLISION 0x08 /* sample collided with another */ #define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 /* PMU specific trace format type */ +/* CoreSight PMU AUX buffer formats */ +#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 /* Default for backward compatibility */ +#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 /* Raw format of the source */ + #define PERF_FLAG_FD_NO_GROUP (1UL << 0) #define PERF_FLAG_FD_OUTPUT (1UL << 1) #define PERF_FLAG_PID_CGROUP (1UL << 2) /* pid=cgroup id, per-cpu mode only */ -- 2.24.1