Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3735318pxf; Mon, 29 Mar 2021 09:58:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWh0K+N/OWJHtSNsGJ6NH7AqjsprDypDiPqn/9yUGyvC5FbuTHBGH8hlC6SWar9v/BnTLo X-Received: by 2002:a17:906:b817:: with SMTP id dv23mr29993053ejb.281.1617037112289; Mon, 29 Mar 2021 09:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617037112; cv=none; d=google.com; s=arc-20160816; b=ZUhr22UBIY6qPl476odo8ZFz465VrTWwsD5qeBRaOIjua1uwX0cnrNG543EyEmUpgA mb8tcwbXAu/bW3A9pOOsOisIlUAKzytquW9j1ldIaXn+NKVPv+qFhV65eglBO2Pu64cW St1kqluihahHE5IxkuzsQavCSZMltoilToarwKFz+khAIs0T4dgtPUIJP7+xOObO6G00 Hb8Bw4xmH6yVT/tDBMTTAnuol3sgGcDEsDk9n4RnpK4HSXsLyFcMnEMYzSX17VNbILSv NiEpZfSdYnGi0AGNRuoIcSx6UbbUv3llhuQGMDjNVsM/X2uEhmaG5pQKO7g1FaQhWt2G hXpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=41gsrhQeTp6iRdsdb+HSRGikGLjU4hdDe4OQqkyN7Qk=; b=XlhzC3V6uTNKqLd52b0vZcgZcgRMoW9Rs7rOOZQ694dPPXiJwz2Heb4VtXolfSoseN B66BW5AnVvq7PZmts+vMdoAypPPtnIqn7iUqNtKXueqvLs/sDo1x+4t1qK5uGojQk6lK YELwifoCoqtoKCyj+vQNO4RnPYaKK1FdJ+BEkI1ZB9OwLdhpWi1Vceat4GKiDg3Z0LB0 VpWGY/QOTgMiAaOTKauAVkM1sVtoD434ImiiTIMoxwGUgm44YTveMGRUhi0pc5kzW2UA K0KZktRzFD68mr3QyDjRcahq/HH63LNhVYfomoFprYXmECIErLUo77FB/zTtGCEfpHN4 pFSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LnrkPfWP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm7si12377037edb.188.2021.03.29.09.58.09; Mon, 29 Mar 2021 09:58:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=LnrkPfWP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229479AbhC2Q4k (ORCPT + 99 others); Mon, 29 Mar 2021 12:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbhC2Q43 (ORCPT ); Mon, 29 Mar 2021 12:56:29 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B4C1C061574 for ; Mon, 29 Mar 2021 09:56:29 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id t18so6292986pjs.3 for ; Mon, 29 Mar 2021 09:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=41gsrhQeTp6iRdsdb+HSRGikGLjU4hdDe4OQqkyN7Qk=; b=LnrkPfWPiMY+YoSb4/gORGVIa+wQfgD3GORzXUL4+w+m2w1LdZMM25aNWwHVP1Pe4D 7SNSphcAaPHrVJaqIw8ZJ9I4qLeISnRJD0JBpl+4K+50AX9RJB2c8pbXCab7vWB83wpZ xx18ySZ2dL91F8VtMgQiRZt86T+zQAaG++bR2OcZpNCHZIU7akctyUgxs6jzznvEKMPx NIa++j6wHE4nawRyiMF/UsUpg9SffBIlFgKKsVlxvGy02Cg1zw8jDELuv5c3N5gy8wkh kVDd4xPmg4AR/HgQ+ISiSAqe7TZC5t/R1oahGAKHJCVKIVnuOKdHoCDQU8BYLqgA6ODz AwPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=41gsrhQeTp6iRdsdb+HSRGikGLjU4hdDe4OQqkyN7Qk=; b=Xl491yMHLtfI78RmA8yYd8mXRzX7+MJ8qOxXW/yYCPbpI/QQuv1tRPtTcM5uDI4Q10 X5S2ohUAMukqv5SSxkd/gYmJZUzoUcNTV2dqCDjv0l4X/T6b8FC95lq2Bvfj1b21zA8s 4D+yNQAUNcke2rIwp8PiutfgMv9fTh8gZ44xqmDIe+YA0BwyToOQsZtsxkTmgvvGY7X3 OjkTtByvGw/fPAiwYWG50g8gccUnWO05E2EewJG5Fi30fUjQVt8Zk105AyB66EkXlGdy D7X1fooEZVly6RXrVWhOV6ctbx1UpIINkm7+0X2t/y3CSbTr8/fO87jOsL4JndDJCuXb Ge+A== X-Gm-Message-State: AOAM533rnSXLx5WO/eE8liD7R+VYuDMaIlsGw2f0anJ4ULHiyU1AIALj e91lvUbrlI5vlJZ2Cuqn5a6q6g== X-Received: by 2002:a17:902:c204:b029:e7:32fd:bc8f with SMTP id 4-20020a170902c204b02900e732fdbc8fmr16366279pll.43.1617036988444; Mon, 29 Mar 2021 09:56:28 -0700 (PDT) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id y7sm18118497pfq.70.2021.03.29.09.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 09:56:27 -0700 (PDT) Date: Mon, 29 Mar 2021 10:56:25 -0600 From: Mathieu Poirier To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, anshuman.khandual@arm.com, maz@kernel.org, catalin.marinas@arm.com, Peter Zijlstra Subject: Re: [PATCH v5 04/19] perf: aux: Add CoreSight PMU buffer formats Message-ID: <20210329165625.GC2236953@xps15> References: <20210323120647.454211-1-suzuki.poulose@arm.com> <20210323120647.454211-5-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323120647.454211-5-suzuki.poulose@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Tue, Mar 23, 2021 at 12:06:32PM +0000, Suzuki K Poulose wrote: > 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 */ > + Have you had time to review this patch? Anything you'd like to see modified? Thanks, Mathieu > #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 >