Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1695379pxb; Thu, 4 Feb 2021 21:46:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJy94Q5/WClh0jGsZGvTzaiW/aq3BLOLecMz/EkVHC3T/a03oYGxEQfurUIJLbCXCukBPjmi X-Received: by 2002:a17:906:b217:: with SMTP id p23mr2595341ejz.126.1612503963685; Thu, 04 Feb 2021 21:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612503963; cv=none; d=google.com; s=arc-20160816; b=a0OPpML+F+7uA35Y92VB0wec+sc7raVYrdxLjHUU7sHLh0LsrfnPQvADMaSu34rkOp WodAxSC1TlOqQ+BCMUbk/F2qZ+DJ2C+q5MQWCTRf8QXMjZoaBRx3x5ogjOwtTlcLY/SA QsxPep+cGBgL5vptS+0NpNxKOu+W+o+UZyS0OdFufoCRGmlYUq/n6poZ9NWt+2itDGtl 0dkqLfvNNfdandgdUONY8BndW7marmtVQZt8GxjSrcIFb4ob5vMfa2sCQkdIzIkkd2cn 85Uru80K0YzoOEJYGojwrkvUpG/XU7EzvYRyxiJtIIFfk0VVY44bEqwwjjljgKPLeXQ6 vCkg== 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=FvgdxNInb0oVeGhL4PW/aE3z9p2JTGo1itzqu/MywdU=; b=r1IMkq0qAR6MNt/+zSfYl8QLqJL9YKCX1qcJ2+zKrSJtEy8j7FtkEko+f48GiHhzvq ZCTsQPEKgqK86MI3PGfbIKKl/LYcrML4aP+JGME1wfTHK7bBCNB+5HcqTVXAMwAdURPG H4sWAEJ6A5diKCrVLmNX/h/AMtLTAVpGdLbp0fl4ebRNZJtkmazmrW3gup0vUdQSrXRP 18fzuO9xcZVKxM690lPnw2pjLH4gr1zejnB2dvUFzvUArmE2x7iddeEP1+SlqNS2PrF+ jitI2k9BZROn47x4S5dJTtV0uqEfrvcSyC3Xr6ExuASk8RkXOwSTs2xGVgRoZ7wG6pYX JUIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IVavZq/G"; 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 z13si1097035edl.531.2021.02.04.21.45.25; Thu, 04 Feb 2021 21:46:03 -0800 (PST) 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="IVavZq/G"; 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 S229587AbhBEFnF (ORCPT + 99 others); Fri, 5 Feb 2021 00:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbhBEFnF (ORCPT ); Fri, 5 Feb 2021 00:43:05 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6538C061786 for ; Thu, 4 Feb 2021 21:42:24 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id lw17so6150556pjb.0 for ; Thu, 04 Feb 2021 21:42:24 -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=FvgdxNInb0oVeGhL4PW/aE3z9p2JTGo1itzqu/MywdU=; b=IVavZq/Gz1USEIInGrPz5TOyKYbE7Ob0IDyu79VNFqRAXQ22ugPOPN46o+Ih/VEElJ CNgSWlsrmttQ/emnDT7r3DbntylSHCDXTOoEs6NgtTLCONEi1eY0ARVAQzM4x4cvJv8i SLDcqIEmh/U3NlxLI11F+4wTjU84tHh40hAC0xZYFxeBaDAmRGnYXy3fFFMHk9Ki34vm I5FyNT0gVVW6oDa0sDbqGY3rLV+EpnVQdSPlQffa5RQI/8yLJzc8e1tRKN/j2t2zL9Vv Zv/qy++/SMo7tLo8elxjwL3yYgSY/hOjtqJArootYSi4DIGA/IKPTZrk0RyFwAqzH4cJ +whQ== 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=FvgdxNInb0oVeGhL4PW/aE3z9p2JTGo1itzqu/MywdU=; b=HHv1CUfxJici68MYOY2Xhyhy1Wif5BEURz8C81XcyENhnqD5h9uFTAn/SLbw0v8mNP xtx6o2YnsbnTHz8iwYThBpYk8Ib3VYa7vImf3DA/LPAOXIeJLjqG0O4D4QfmVpEfK0LR AxonfkoKm6qO7bhrva66eTL0TX1zT+mizK02OIw8Ht72qhqF7aH9GAHEZLpOJJp9vgn3 QGoy9wbtjJwReRWec/3eCXG6XTGGOYDVrrEPUo9hTP2CYC5bumLMYPL2G4y9xS6pl171 4samfjWWvbq9GOWyNZFWU7bREtWnCY3MeNU5i0epPi2QQStb1Hj0rx6T7JM19nrTkgv+ l1Gw== X-Gm-Message-State: AOAM532tyreqgoV1vC4GCdwCL9hmj16Pu4DIqh1n5TRDvMBxsWu64L7R nRDFKvtaKxYhvtmX35gnE9j1Ew== X-Received: by 2002:a17:902:a614:b029:e1:5b43:956a with SMTP id u20-20020a170902a614b02900e15b43956amr2909593plq.38.1612503744336; Thu, 04 Feb 2021 21:42:24 -0800 (PST) Received: from leoy-ThinkPad-X240s ([202.131.71.236]) by smtp.gmail.com with ESMTPSA id j9sm8572756pgb.47.2021.02.04.21.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 21:42:23 -0800 (PST) Date: Fri, 5 Feb 2021 13:42:16 +0800 From: Leo Yan To: Mike Leach Cc: Suzuki K Poulose , Arnaldo Carvalho de Melo , Mathieu Poirier , Jonathan Corbet , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , Coresight ML , linux-arm-kernel , "open list:DOCUMENTATION" , Linux Kernel Mailing List Subject: Re: [PATCH v2 7/7] Documentation: coresight: Add PID tracing description Message-ID: <20210205054216.GB5797@leoy-ThinkPad-X240s> References: <20210202163842.134734-1-leo.yan@linaro.org> <20210202163842.134734-8-leo.yan@linaro.org> <20210204040909.GH11059@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 12:14:12PM +0000, Mike Leach wrote: [...] > > >>> +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. > > >>> + > > >> > > >> This is telling me that both cs_etm// and cs_etm/contextid/ have the > > >> same effect - trace PID. Is this correct? > > > > > > > Just to make this clear, this is not a side effect of the patch. > > Which is fine - but the documentation should accurately reflect what > is happening on the system. > This is a new paragraph about the PID tracing or otherwise, Even if > some of the effects pre-date this patch, they have to be accurately > communicated. > I am also reading the new paragraph in the context of the rest of the > coresight.rst document - which is a user level document explaining the > basic operation of the coresight system and tools. > This document mentions no other perf command line parameters relevant > to coresight other than the @sink option.It actually calls out to the > OpenCSD docs to provide further information. > > > The perf > > tool driver automatically adds the "contextid" tracing and timestamp for > > "system wide" and process bound events, as they traces get mixed into > > the single sink. So these options are added implicitly by the perf tool > > to make the decoding easier. > > > > That's fine - I have no problem with contextID trace enabled by > default. Context ID is relatively low overhead - and only emitted at > start of trace / context changes. > But the explanation of the parameters currently reads as though they > always have an effect - and not putting them in there will omit the > effect - unless you spot the very subtle line at the end. > > The user does not need to know about parameters that have no effect! Thanks for the suggestion, Mike. > Perhaps a better approach would be to explain the above - an explicit > statement that "perf will always enable PID/ contextID tracing at the > relevant EL - but for EL2 it is possible to make specific adjustments > using parameters......." Usually users assume the PMU format has no effect if without set it; but this is not the case for the config "contextid", this config has been automatically enabled by perf tool. Based on your suggesiton, will refine the descrption for two things: clarify what's the common usage for EL1/EL2, and what's specific for EL2. Thanks, Leo