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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 17D51C433E0 for ; Mon, 8 Feb 2021 20:51:29 +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 91C4864E59 for ; Mon, 8 Feb 2021 20:51:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91C4864E59 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:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cTbj7MzOF9Vqja7FQpMJzdEL3MunHa7/NlLECaMzlqA=; b=Nnuoc3hJ6Uk695N3nBdXtG+BM JccVHjtReP7197MRLd7Xgx7wA2ka3Why4fIoK+abjELT6WAFvJRvSLd+4bAoJLX7qmX/nOW3aPfTy K9ztCGOfWkks/AyuPlrdjaUZmocAA6ZC7gctF269q6FFQzkXe9GKFikEKEuHK2z+pEdP91auCy/zg lJuIR+lGbO7nafXxac2YCTpJWRnIgtiQnSzjwe93Q/gXn0N78tmxW5Z4sO38uUCy/o8xZDrqja0gk tYxxDncF6mGPxbtVBg60YPPQAH2O3bNn+B79pxTsFITCMRQpg6FjpOl1dKlRpnUgbMGpPAqerz/5H D4ZeKIbbA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9DU8-0006Ba-Ny; Mon, 08 Feb 2021 20:50:16 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9DU6-0006AY-4K for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 20:50:15 +0000 Received: by mail-pf1-x430.google.com with SMTP id q131so10469673pfq.10 for ; Mon, 08 Feb 2021 12:50:13 -0800 (PST) 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=u6IfnsP0ojYs9bBbfSN2AV8/9g+W1u8UiUTHBbYsgGw=; b=cQv3mgr+I3zhCFT27jgZlHwYAXYJDwaroszbLx6QqDLwyQmnVlY0Y0Glw2obdc57RY udJk04djvd1MFHz9FBcHt/iqZedYUoUUzeuT6QF2XYi+TcmKbWvwAnYJ+tr/rcaKXmMG QrBlFD3pRbnv0o0a3c44rv8+cT9PBbUYScAPifaZ1yTZUBcCiX4anhoJKeDGjAlSrVkU Mfw5srtAIVv1V9A1IeiXMWshduuQIvFB4L+bUsq98GaxRlUODGV7s9OwPztTQtcxUl5p R3tMFconIN91aGS5dVVjbko+vG16iqfboSDn3y/xCIw15+FbNcxec6KX2jBIZWkqQ8PP lOtg== 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=u6IfnsP0ojYs9bBbfSN2AV8/9g+W1u8UiUTHBbYsgGw=; b=eOSdeo+/EC4zc6HW6MhvOi4Dv/+06BOTjQQo0Cdcl42i1csfOEUy+eaVqHS3iyV0zR 6b9+7nW8xTJ4dGh6uchMKc0P5fKQwf/bu/g/Qh8cYw6K6QqH+YVAOm621eAwQhi6SDn2 JMuAH8+rH6fDLFP9+CT5XIhKV71yJ34v7Zx7QgbQlYoU/pKjd440CXK+3Aytd3zmw/yx 472TagayelkDzo7nQe80atF71qFOmURB90RjjYGni5LnDAZYe6ryHl7wO+sB5GarorHX 2HdVJJhxxgYuhbjMDZK6PFQo8Yf8PDIGquLnYj4RnVcvN3FrZH5pJrgapCbCTMVGn/aB T04Q== X-Gm-Message-State: AOAM530uMyuvkxcHP/3WGQYrD1oVZJ9YgUWIVn9hTPAx2uxXByOeQ1JC Hym9dYoEbj2CcmnHf9nwe2bYPw== X-Google-Smtp-Source: ABdhPJwxIcjG3H2Xj53pz2Rdq3hRXSSTEx1KT0ox4L+e0zlymbOJcMAKaks/kgaUcljk1dDsbkcayw== X-Received: by 2002:aa7:94a2:0:b029:1b8:eba7:773e with SMTP id a2-20020aa794a20000b02901b8eba7773emr19587102pfl.51.1612817411612; Mon, 08 Feb 2021 12:50:11 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id o4sm164662pjs.57.2021.02.08.12.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 12:50:11 -0800 (PST) Date: Mon, 8 Feb 2021 13:50:09 -0700 From: Mathieu Poirier To: Leo Yan Subject: Re: [PATCH v3 8/8] Documentation: coresight: Add PID tracing description Message-ID: <20210208205009.GF2077938@xps15> References: <20210206150833.42120-1-leo.yan@linaro.org> <20210206150833.42120-9-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210206150833.42120-9-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_155014_192291_EA9AE064 X-CRM114-Status: GOOD ( 31.91 ) 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: Mark Rutland , Al Grant , Denis Nikitin , Jonathan Corbet , Peter Zijlstra , Jiri Olsa , coresight@lists.linaro.org, John Garry , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Ingo Molnar , linux-arm-kernel@lists.infradead.org, Namhyung Kim , Daniel Kiss , Will Deacon , Suzuki K Poulose , Mike Leach 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 On Sat, Feb 06, 2021 at 11:08:33PM +0800, Leo Yan wrote: > After support the PID tracing for the kernel in EL1 or EL2, the usage > gets more complicated. > > This patch gives description for the PMU formats of contextID configs, > this can help users to understand how to control the knobs for PID > tracing when the kernel is in different ELs. > > Signed-off-by: Leo Yan As I indicated I have picked up the kernel patches in this set and there should be a new patchset sent to Arnaldo. The only thing left is this patch and I will give time to Mike and Suzuki to look at it before I add it to my tree. Thanks, Mathieu > --- > Documentation/trace/coresight/coresight.rst | 32 +++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/Documentation/trace/coresight/coresight.rst b/Documentation/trace/coresight/coresight.rst > index 0b73acb44efa..169749efd8d1 100644 > --- a/Documentation/trace/coresight/coresight.rst > +++ b/Documentation/trace/coresight/coresight.rst > @@ -512,6 +512,38 @@ The --itrace option controls the type and frequency of synthesized events > Note that only 64-bit programs are currently supported - further work is > required to support instruction decode of 32-bit Arm programs. > > +2.2) Tracing PID > + > +The kernel can be built to write the PID value into the PE ContextID registers. > +For a kernel running at EL1, the PID is stored in CONTEXTIDR_EL1. A PE may > +implement Arm Virtualization Host Extensions (VHE), which the kernel can > +run at EL2 as a virtualisation host; in this case, the PID value is stored in > +CONTEXTIDR_EL2. > + > +perf provides PMU formats that program the ETM to insert these values into the > +trace data; the PMU formats are defined as below: > + > + "contextid1": Available on both EL1 kernel and EL2 kernel. When the > + kernel is running at EL1, "contextid1" enables the PID > + tracing; when the kernel is running at EL2, this enables > + tracing the PID of guest applications. > + > + "contextid2": Only usable when the kernel is running at EL2. When > + selected, enables PID tracing on EL2 kernel. > + > + "contextid": Will be an alias for the option that enables PID > + tracing. I.e, > + contextid == contextid1, on EL1 kernel. > + contextid == contextid2, on EL2 kernel. > + > +perf will always enable PID tracing at the relevant EL, this is accomplished by > +automatically enable the "contextid" config - but for EL2 it is possible to make > +specific adjustments using configs "contextid1" and "contextid2", E.g. if a user > +wants to trace PIDs for both host and guest, the two configs "contextid1" and > +"contextid2" can be set at the same time: > + > + perf record -e cs_etm/contextid1,contextid2/u -- vm > + > > Generating coverage files for Feedback Directed Optimization: AutoFDO > --------------------------------------------------------------------- > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel