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 B1C4BC433E9 for ; Thu, 4 Feb 2021 03:38:08 +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 5C22C64F5D for ; Thu, 4 Feb 2021 03:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C22C64F5D 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=p/tYVM4frogp5hhgSzlLgsnby1kGXJid20/KnVDvjxE=; b=rgXRA3IWTXvmBMcxWo2YxlTwr pwuZeieWHkY6E7OeNwfizZvB15PXqe1XMSn5shAKa5NFeF2xGe3bY13ncbZNXoGpoE1ywVYjFrcLf JOAJAzeR3f+WOSLqjmDdX3J7MtMoISLvWzOOjKEhwTlsmtELdJeTj0VLp4albGldktCEDq+U2wnnj HTdESd504T+cGt7dqvYp09n0GgKEIUlnhrT9CJ2NwcaQSyMVfRJObd5vRCIlaVCUFeteubxLuU9HI 7T6HEmzmDLQNxIDM5H+HFhwnMpcTE1sw/wTD4wClF9M949SVA18CCsILvDdzN+OjAMEwl6iGr8znE peQOUKglA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7VRu-0007PK-GP; Thu, 04 Feb 2021 03:36:54 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7VRr-0007O4-9L for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 03:36:52 +0000 Received: by mail-pj1-x1032.google.com with SMTP id g15so972119pjd.2 for ; Wed, 03 Feb 2021 19:36:49 -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=z/pPsjpNFL1AOj/V+7CEjl7TXj+nEWHQjNVxoyWjhMA=; b=JpENPKrAHYNY/1bfV8ya7o3ydolLhfwkhhlfiq8Y3ndGsBDNZyyREvA3oxsFX5NrLu 4OIN/wsPWAe+9uxm8bYw9PRkGKOpaNMyy1bZxgMADjqDFDWavvkIW8pfwnbtdMYJVHiS aoa+yBHC35SfUiJyFFSbt64rikzTW9O/Pe9aifCLXGqIgqIeRGqJDDIGCS80tEyxjz9O YGQ7TOZc/0YQWMv7mv9sabhRHFo7ehY3pS8Z5iFZFdZ+ituSWgAW9m7MSMJow24O6OhV H6R2lzwkZaFSLHYN7CU1mIExLhtBG5+jJ09bmAhUjVp4LRbBEHuBFwN0pxsZtoianbJs bINQ== 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=z/pPsjpNFL1AOj/V+7CEjl7TXj+nEWHQjNVxoyWjhMA=; b=ZOqDk9l3mew+zfK9Dzb3JguSgRJf2cSU672coR8FvPV1ABL+OBk35JUaQVgNZJWLye YbaYPmTUfzC81IN9dGnZrW4SPLZdxc8leeRtpXLYZ6EBvENuime7pogvUBVNA+KnUaro mZtOQmrMdaHTiwQE/oXan4qQ26hIlce/GfETsLsFqkqshvpwhxidNgFB4dA9DRKivBWp hClYkLndbY2s9mGOjAdvWesOA/brtDHDV5ebKUNqBT9DAEyDbU1S9SOLeuKFP3nfbQ0t acSj99Z2MD/cqDGjrl1Aa5blxNtdAWif5vCYi8WNn8r0CjMyTjF81BmU+a1S+vCYT47t YtgA== X-Gm-Message-State: AOAM533eNQvMnEe+7GToaWyylTXEUsdqS/CFU0tcJ4aTjTB4ux8QO2QP 7aIzxUcgLivayykRkC04+z52Jw== X-Google-Smtp-Source: ABdhPJzbPCh4kVIug8LRnR3bHrD8di6i9tGyckVHug4fny38LYmXqhAqJ9xCPXH7CsEth7n7+NrJew== X-Received: by 2002:a17:902:503:b029:e1:82d:bd4f with SMTP id 3-20020a1709020503b02900e1082dbd4fmr6078956plf.28.1612409807296; Wed, 03 Feb 2021 19:36:47 -0800 (PST) Received: from leoy-ThinkPad-X240s ([202.131.71.236]) by smtp.gmail.com with ESMTPSA id w13sm3936565pfc.7.2021.02.03.19.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 19:36:46 -0800 (PST) Date: Thu, 4 Feb 2021 11:36:39 +0800 From: Leo Yan To: Suzuki K Poulose Subject: Re: [PATCH v2 1/7] coresight: etm-perf: Clarify comment on perf options Message-ID: <20210204033639.GD11059@leoy-ThinkPad-X240s> References: <20210202163842.134734-1-leo.yan@linaro.org> <20210202163842.134734-2-leo.yan@linaro.org> <071d1235-c8c4-7b3f-11ce-91c1f907ea8d@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <071d1235-c8c4-7b3f-11ce-91c1f907ea8d@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210203_223651_635219_D1F911E4 X-CRM114-Status: GOOD ( 31.16 ) 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 Hi Suzuki, On Tue, Feb 02, 2021 at 11:00:42PM +0000, Suzuki Kuruppassery Poulose wrote: > 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 ? Yes, will split the patch. > Either way, for the patch: > > Reviewed-by: Suzuki K Poulose Thanks for review and suggestion. > > --- > > .../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