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 EE028C433E0 for ; Mon, 8 Feb 2021 20:48: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 8856164E74 for ; Mon, 8 Feb 2021 20:48:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8856164E74 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=mvtuVAZ7unVAG7FKvnbOfkvsOOm6BlG7BwkUB/WOxlk=; b=P94/8kvK38u3kSqIap4k+d7TZ AmvBRp6CzaHtCaEo5EiprRz9BCvdCC8Gy13D/ymVbKxYjK3PcDh9OW6EWbydwnMCsgaB83Nk1v9K7 2yrBR0+0uX7Sv8jHo21RFvpXY3KV6vDau15y7y2ogcpnTCh5Smke3jY28ES60NwbU43eDtNggfhxu BW16KpaSjeTH5y8hzMxqv4jjrbPO1u2lHYh+gTQzDbn3uBCVE0nM00dhcTSlo6PDZIpdkexaJ8YqK uwg0+9aJGdKfERA/0g9tgWpu7Fffzv1yKup0oZY9ZlnwUKwYuqnAEcO9+EnZktBgfSYCnbrlad/uB TmLXmk3PQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9DQn-0005sb-Aw; Mon, 08 Feb 2021 20:46:49 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9DQk-0005rl-6A for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 20:46:47 +0000 Received: by mail-pj1-x102c.google.com with SMTP id lw17so441570pjb.0 for ; Mon, 08 Feb 2021 12:46:45 -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=Nydmi+Z7dBjgeCcCDgZoX6CcBj+BLGtfo85qqn1BPpg=; b=sN9kwECThWrCOEMJbhZDr20zfKqu4hiYVFCtMtzV/d4T8agGwPvkVRAm1jaVsnFLMA zq0S4sxSVtrXfCovi0X2W4vzVWUQXpiMXrgUKX/Loo0bgfm2e3HUwVocjvQCtTsyDzGN w7z/Jmljowu0s1/nqJ2y5xmnJwYZ7tsiUv452/U+5D89C6uoOIeo4ToFm2xVlqJWrCTc sDTzf0q8aBUjyp/jSW1j5BC6qelbYAZ6AGQ1EB1ooSi7VEIKfx11C18yCs4hLt+omeAn mOmclgiZrT4XlADRZQSlmoHUBMUfEQ9kZYvQF5Tutgl1Yc/3QUv9sG0st5eNuG3cBtmP +Whg== 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=Nydmi+Z7dBjgeCcCDgZoX6CcBj+BLGtfo85qqn1BPpg=; b=iszFC/4dmU+oUkORTn/YUUBNLWUZPNBwf97axTU1TMtjDxBrjAzf9sVmFMotUhBTHj oPjqSXrlegFyAUEMF1AkTlTm3wm+ppmJAtAXSscWOpbBZ6wBOd7BEuJsVdsSQJUWRlV9 xPQgNtM49FdLroHnd9UISOgCQBm8br7MopbVW5Z6OCgSg1iqmKzdu3DHW7e6kjnG9Vd8 lhgSK10UO/Fvr0MX55UHnjU6GzRDLqv/UU6mpdwz7y7zejM/0uCvX54sZx9m4rA6To9I /D+SK14bMcAiQzXpMCV1kpyVrXE8sglvj9QGWt+7ac2hWZIddJEE+NaEK2PIzhaw/mfF nefw== X-Gm-Message-State: AOAM531+HljtwuTzLjQ0UPt0+0JRhmo7dK/yK/HrAYdynAtYPPBpp9ps YC8ev3RcyI0Z3qndiWvhHlPIuQ== X-Google-Smtp-Source: ABdhPJxT8tmoBFSFsgvBkPIWKmaKICYyejFedyDus9d4qQqOPYyHjB6zplHhLeIiABk8big74avaow== X-Received: by 2002:a17:90b:83:: with SMTP id bb3mr615336pjb.162.1612817204210; Mon, 08 Feb 2021 12:46:44 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id t25sm6741032pgo.87.2021.02.08.12.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 12:46:43 -0800 (PST) Date: Mon, 8 Feb 2021 13:46:41 -0700 From: Mathieu Poirier To: Leo Yan Subject: Re: [PATCH v3 4/8] perf cs-etm: Fix bitmap for option Message-ID: <20210208204641.GE2077938@xps15> References: <20210206150833.42120-1-leo.yan@linaro.org> <20210206150833.42120-5-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210206150833.42120-5-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_154646_248157_79D97B90 X-CRM114-Status: GOOD ( 24.44 ) 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:29PM +0800, Leo Yan wrote: > From: Suzuki K Poulose > > When set option with macros ETM_OPT_CTXTID and ETM_OPT_TS, it wrongly > takes these two values (14 and 28 prespectively) as bit masks, but > actually both are the offset for bits. But this doesn't lead to > further failure due to the AND logic operation will be always true for > ETM_OPT_CTXTID / ETM_OPT_TS. > > This patch defines new independent macros (rather than using the > "config" bits) for requesting the "contextid" and "timestamp" for > cs_etm_set_option(). > > [leoy: Extract the change as a separate patch for easier review] This should go just above your name - see below. > Signed-off-by: Suzuki K Poulose > Signed-off-by: Leo Yan > Reviewed-by: Mike Leach Signed-off-by: Suzuki K Poulose [Extract the change as a separate patch for easier review] Signed-off-by: Leo Yan Reviewed-by: Mike Leach > --- > tools/perf/arch/arm/util/cs-etm.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c > index bd446aba64f7..c25c878fd06c 100644 > --- a/tools/perf/arch/arm/util/cs-etm.c > +++ b/tools/perf/arch/arm/util/cs-etm.c > @@ -156,6 +156,10 @@ static int cs_etm_set_timestamp(struct auxtrace_record *itr, > return err; > } > > +#define ETM_SET_OPT_CTXTID (1 << 0) > +#define ETM_SET_OPT_TS (1 << 1) > +#define ETM_SET_OPT_MASK (ETM_SET_OPT_CTXTID | ETM_SET_OPT_TS) > + I would much rather see this fixed with the BIT() macro as it is done in the rest of this set than defining new constant. With the above: Reviewed-by: Mathieu Poirier I have picked up the kernel portion of this set. I suggest you fix the above and send another revision to Arnaldo with my RBs. > static int cs_etm_set_option(struct auxtrace_record *itr, > struct evsel *evsel, u32 option) > { > @@ -169,17 +173,17 @@ static int cs_etm_set_option(struct auxtrace_record *itr, > !cpu_map__has(online_cpus, i)) > continue; > > - if (option & ETM_OPT_CTXTID) { > + if (option & ETM_SET_OPT_CTXTID) { > err = cs_etm_set_context_id(itr, evsel, i); > if (err) > goto out; > } > - if (option & ETM_OPT_TS) { > + if (option & ETM_SET_OPT_TS) { > err = cs_etm_set_timestamp(itr, evsel, i); > if (err) > goto out; > } > - if (option & ~(ETM_OPT_CTXTID | ETM_OPT_TS)) > + if (option & ~(ETM_SET_OPT_MASK)) > /* Nothing else is currently supported */ > goto out; > } > @@ -406,7 +410,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, > evsel__set_sample_bit(cs_etm_evsel, CPU); > > err = cs_etm_set_option(itr, cs_etm_evsel, > - ETM_OPT_CTXTID | ETM_OPT_TS); > + ETM_SET_OPT_CTXTID | ETM_SET_OPT_TS); > if (err) > goto out; > } > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel