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=unavailable 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 2BFA1C433E0 for ; Thu, 4 Feb 2021 04:04:07 +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 BDAB464DA5 for ; Thu, 4 Feb 2021 04:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDAB464DA5 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=vEKZXMqlGCRiOUdj9qCbMhwii0MDVeEWr60ooRNYq7c=; b=tf8cvHSZMPoYI+8mEttJNP0L0 sByxHp0bqcs9vn4HZ2sCNwLMAaN2qjgaTcNoJlSN/L7ThbBQYzkHquziYkmku6wTohUiXVYjUFVxi JbZG1VmsdjPM8FfnDoSBKt3quFvhu0gR88wppXWxGC1AkZMOTpxG1uIcOWjzo2vzLBNZwwHlEWlkV nC1Dw0JtbHWYfpHrHI8a7T7uptIBDYJN1Y6JQQhFliabxRvW5ybu0x+1aJJdrTXxODvGX45Gja8HC zdt5Y1vPsBl/QlmoEtA1bcMRQps+gI8wFEr7D5dWe7fJI9QMkZyPOPwXWyR3S1niuNY3CdxezF2ps Px950c9lA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7VrA-0001NZ-QB; Thu, 04 Feb 2021 04:03:00 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7Vr7-0001Ml-OQ for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 04:02:58 +0000 Received: by mail-pg1-x52d.google.com with SMTP id o63so1216091pgo.6 for ; Wed, 03 Feb 2021 20:02:57 -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=M85X1MjJYGgo1IfIZsmjwYJ9uoQMu5IYZdM5xfYzY4k=; b=kxr3c6PQOhqYiDgopnWiM8/AbTzQ+VW7UmO+dimUTFi1E0ZP1uc5gKO4QKAJATIX4e kzRN1s+HW1VPX4v3ZvNh+COBVrP/hj3+4mEBZ4ke1HasW6l95ZSjbLLUbuMjFa0GsTFh sCHZgaZrdRWiQw2GpZRTsXRQ7fpnD+Q7msLKMNtJ1AkCN5yB23Wkjq4BDB2tz2bH7v94 gBPtyT+YSFwFLS22A0PxVTHM2yT7DtsIIj8JUK8SU+f54HdHrGbunMZuxyKery7VyY8S Rwk94H1KWqrs9qMyjidIVbc4rJJjmOrXY0OuYzWfv7wLvMoZ3eaW99UizJeytKrfot2x /5AA== 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=M85X1MjJYGgo1IfIZsmjwYJ9uoQMu5IYZdM5xfYzY4k=; b=gWe20h1+pgNGVonDoPmuFiHvRgGdt4laouvCWOGcmLixPSRt0zuShrsGKrL8YZfhb4 xUMJDZPTnTpbTSR8UeUk9FmXvhC/jDsBgja1AAPiht9iWxg4JlavC4wNnllSETwIs58z kjMhsTEYX+FKbwNxMfR2t13fswo4LujcHOoQVfyZ6LYRssPxD6FVVPzGjSNxBE78T1oX WWSKP7CLLvsVMMQo5cJwswLLgmOWugXOdL6vmBykgqaeKen0QzSEXrUbhTK/ikAZKMbx nYGhmCzABMDyxkKa9xS8y6b3zQ3f0mEFVml1SBzu3orMRERxDPqk8/97UEr+YhJNSGpe LKUg== X-Gm-Message-State: AOAM532TVDsBz1q8/aDWTHDas+GAfywk6Lyx7c9Hf3J8dfhjxiZnTNqb jXZZgd3QqvoEYekg5eev24n3WA== X-Google-Smtp-Source: ABdhPJzyy8hUpxfUgXMdVa0NTlMiwFkbPMkl1TjMr6JrL2kQlzmPMxl+tKyDE0QtDKCtF1Yz9Q6G6w== X-Received: by 2002:a62:503:0:b029:1c0:aed7:c88 with SMTP id 3-20020a6205030000b02901c0aed70c88mr6099543pff.76.1612411375635; Wed, 03 Feb 2021 20:02:55 -0800 (PST) Received: from leoy-ThinkPad-X240s ([202.155.204.36]) by smtp.gmail.com with ESMTPSA id lw4sm3069092pjb.16.2021.02.03.20.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 20:02:54 -0800 (PST) Date: Thu, 4 Feb 2021 12:02:47 +0800 From: Leo Yan To: Suzuki K Poulose Subject: Re: [PATCH v2 7/7] Documentation: coresight: Add PID tracing description Message-ID: <20210204040247.GG11059@leoy-ThinkPad-X240s> References: <20210202163842.134734-1-leo.yan@linaro.org> <20210202163842.134734-8-leo.yan@linaro.org> <451d58bd-e79d-5fb4-a67f-962da02a3937@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <451d58bd-e79d-5fb4-a67f-962da02a3937@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210203_230257_859343_D1307EC7 X-CRM114-Status: GOOD ( 32.08 ) 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 , Denis Nikitin , Mathieu Poirier , Jonathan Corbet , Alexander Shishkin , Jiri Olsa , coresight@lists.linaro.org, John Garry , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Daniel Kiss , Will Deacon , linux-arm-kernel@lists.infradead.org, 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 Tue, Feb 02, 2021 at 11:24:48PM +0000, Suzuki Kuruppassery Poulose wrote: > On 2/2/21 4:38 PM, 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 > > --- > > Documentation/trace/coresight/coresight.rst | 37 +++++++++++++++++++++ > > 1 file changed, 37 insertions(+) > > > > diff --git a/Documentation/trace/coresight/coresight.rst b/Documentation/trace/coresight/coresight.rst > > index 0b73acb44efa..771558f22938 100644 > > --- a/Documentation/trace/coresight/coresight.rst > > +++ b/Documentation/trace/coresight/coresight.rst > > @@ -512,6 +512,43 @@ 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 > > + > > +When the kernel is running at EL2 with Virtualization Host Extensions (VHE), > > +perf records CONTEXTIDR_EL2 in the trace data and can be used as PID when > > +decoding; and if the kernel is running at EL1 with nVHE, CONTEXTIDR_EL1 is > > +traced for PID. > > + > > +To support tracing PID for the kernel runs at different exception levels, > > +the PMU formats are defined as follow: > > + > > + "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. > > + > > +The perf tool automatically sets corresponding bit for the "contextid" config, > > +therefore, the user doesn't have to bother which EL the kernel is running. > > + > > + i.e, perf record -e cs_etm/contextid/u -- uname > > + or perf record -e cs_etm//u -- uname > > + > > +will always do the "PID" tracing, independent of the kernel EL. > > + > > +When the kernel is running at EL2 with VHE, if user wants to trace both the > > +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 -- uname > > + > > To make this case clear, we could change the command from uname to > something like: > > perf record -e cs_etm/contextid1,contextid2/u -- vm Exactly, will refine. > Otherwise looks good to me. > > With the above fixed, > > Reviewed-by: Suzuki K Poulose Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel