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=-15.8 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 67A33C433E0 for ; Tue, 2 Feb 2021 23:02:20 +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 1A20864F6A for ; Tue, 2 Feb 2021 23:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A20864F6A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7qL8Y+lfGVnPPYJ/vXWHgggKTmB0ytovSwzFYWF+YJc=; b=vBC1NexHA1RJ6JjG1O5NEv0Vk sTdBFKnJ5ita2NBIZ/KXXAQ+hj93p0muOopceUD9f5zbmeTNSALQsxT5MCFJatGGxkJ7ZwrC9yt+Y 4r+O6XJyOSxUSEt4mmcYUEPCBXX2Sm9YGRmRQCzPXhaL5QOHW40YwCM15bWMNfYU/BWYUDvRklfkA neEwJuxR+fYKb3iiXnqYVEaq1PWF3K0Mt8VosmpoLUE779mYBuxeYLQn7O1DQ2Z1QJ7zexmud1GeB NtnDKw9cZPdYCGzWmQnAUxgvepOK3ORM742bJNifITMFyEaeyix2xsiBydEpaFAteXgTU/+x2dGin Iz886Ft5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l74fQ-0001wy-5q; Tue, 02 Feb 2021 23:01:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l74fM-0001vn-Vf for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 23:01:02 +0000 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 A8F54ED1; Tue, 2 Feb 2021 15:00:59 -0800 (PST) Received: from [10.57.35.108] (unknown [10.57.35.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 100F03F694; Tue, 2 Feb 2021 15:00:55 -0800 (PST) Subject: Re: [PATCH v2 1/7] coresight: etm-perf: Clarify comment on perf options To: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , Mike Leach , Jonathan Corbet , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210202163842.134734-1-leo.yan@linaro.org> <20210202163842.134734-2-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <071d1235-c8c4-7b3f-11ce-91c1f907ea8d@arm.com> Date: Tue, 2 Feb 2021 23:00:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210202163842.134734-2-leo.yan@linaro.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_180101_166586_4ADFD73E X-CRM114-Status: GOOD ( 28.43 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Leo On 2/2/21 4:38 PM, Leo Yan wrote: > In theory, the options should be arbitrary values and are neutral for > any ETM version; so far perf tool uses ETMv3.5/PTM ETMCR config bits > except for register's bit definitions, also uses as options. > > This can introduce confusion, especially if we want to add a new option > but the new option is not supported by ETMv3.5/PTM ETMCR. But on the > other hand, we cannot change options since these options are generic > CoreSight PMU ABI. > > For easier maintenance and avoid confusion, this patch refines the > comment to clarify perf options, and gives out the background info for > these bits are coming from ETMv3.5/PTM. Afterwards, we should take > these options as general knobs, and if there have any confliction with > ETMv3.5/PTM, should consider to define saperate macros for ETMv3.5/PTM > ETMCR config bits. > > Suggested-by: Suzuki K Poulose > Signed-off-by: Leo Yan The patch looks good to me. The only concern I have is, whether we should split this patch to kernel vs tools ? As the kernel changes go via coresight tree and the tools patch may go via perf tree ? Either way, for the patch: Reviewed-by: Suzuki K Poulose > --- > .../hwtracing/coresight/coresight-etm-perf.c | 5 ++++- > include/linux/coresight-pmu.h | 17 ++++++++++++----- > tools/include/linux/coresight-pmu.h | 17 ++++++++++++----- > 3 files changed, 28 insertions(+), 11 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c > index bdc34ca449f7..465ef1aa8c82 100644 > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c > @@ -27,7 +27,10 @@ static bool etm_perf_up; > static DEFINE_PER_CPU(struct perf_output_handle, ctx_handle); > static DEFINE_PER_CPU(struct coresight_device *, csdev_src); > > -/* ETMv3.5/PTM's ETMCR is 'config' */ > +/* > + * The PMU formats were orignally for ETMv3.5/PTM's ETMCR 'config'; > + * now take them as general formats and apply on all ETMs. > + */ > PMU_FORMAT_ATTR(cycacc, "config:" __stringify(ETM_OPT_CYCACC)); > PMU_FORMAT_ATTR(contextid, "config:" __stringify(ETM_OPT_CTXTID)); > PMU_FORMAT_ATTR(timestamp, "config:" __stringify(ETM_OPT_TS)); > diff --git a/include/linux/coresight-pmu.h b/include/linux/coresight-pmu.h > index b0e35eec6499..5dc47cfdcf07 100644 > --- a/include/linux/coresight-pmu.h > +++ b/include/linux/coresight-pmu.h > @@ -10,11 +10,18 @@ > #define CORESIGHT_ETM_PMU_NAME "cs_etm" > #define CORESIGHT_ETM_PMU_SEED 0x10 > > -/* ETMv3.5/PTM's ETMCR config bit */ > -#define ETM_OPT_CYCACC 12 > -#define ETM_OPT_CTXTID 14 > -#define ETM_OPT_TS 28 > -#define ETM_OPT_RETSTK 29 > +/* > + * Below are the definition of bit offsets for perf option, and works as > + * arbitrary values for all ETM versions. > + * > + * Most of them are orignally from ETMv3.5/PTM's ETMCR config, therefore, > + * ETMv3.5/PTM doesn't define ETMCR config bits with prefix "ETM3_" and > + * directly use below macros as config bits. > + */ > +#define ETM_OPT_CYCACC 12 > +#define ETM_OPT_CTXTID 14 > +#define ETM_OPT_TS 28 > +#define ETM_OPT_RETSTK 29 > > /* ETMv4 CONFIGR programming bits for the ETM OPTs */ > #define ETM4_CFG_BIT_CYCACC 4 > diff --git a/tools/include/linux/coresight-pmu.h b/tools/include/linux/coresight-pmu.h > index b0e35eec6499..5dc47cfdcf07 100644 > --- a/tools/include/linux/coresight-pmu.h > +++ b/tools/include/linux/coresight-pmu.h > @@ -10,11 +10,18 @@ > #define CORESIGHT_ETM_PMU_NAME "cs_etm" > #define CORESIGHT_ETM_PMU_SEED 0x10 > > -/* ETMv3.5/PTM's ETMCR config bit */ > -#define ETM_OPT_CYCACC 12 > -#define ETM_OPT_CTXTID 14 > -#define ETM_OPT_TS 28 > -#define ETM_OPT_RETSTK 29 > +/* > + * Below are the definition of bit offsets for perf option, and works as > + * arbitrary values for all ETM versions. > + * > + * Most of them are orignally from ETMv3.5/PTM's ETMCR config, therefore, > + * ETMv3.5/PTM doesn't define ETMCR config bits with prefix "ETM3_" and > + * directly use below macros as config bits. > + */ > +#define ETM_OPT_CYCACC 12 > +#define ETM_OPT_CTXTID 14 > +#define ETM_OPT_TS 28 > +#define ETM_OPT_RETSTK 29 > > /* ETMv4 CONFIGR programming bits for the ETM OPTs */ > #define ETM4_CFG_BIT_CYCACC 4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel