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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 F1745CA9EAF for ; Mon, 21 Oct 2019 20:18:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C4B7F2070B for ; Mon, 21 Oct 2019 20:18:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aFCINrbO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4B7F2070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.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=pEE7f3FXn3MgL0R2eNNHSyXioWFDAMJ1tIngimYU6SQ=; b=aFCINrbO2KTz/7 XoFEueft/sml2pclVYo05vHb/B4ECNL+5cqvSJsAai+ymLhTE6O47ZL5xUB+GJBbBfI2hYVRkiHPa 8yNUg1uvvSNFtN4HjWNF6GEPOVqlmjQ6TctONExg3ufwLtSXHSd2baujhYgAxkTmHze4CbUKLPMG2 YfRRTv/D2gsqxvaTZxhopH+Utp3xLGuB/k3F43UTkTOZk73nYWwBgH9j4L6bd34yXt/BR8snlD76n 2EEQ0Ca5dCOPLibdJRI+KXnJ7U77qw8Q5+kb5zH63L8k1zWIr+LOb57sLu+No60fjTwhXx4v3mTDp 6HHWhbbdw2JnOoVnHCzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMe8K-0007Vh-OS; Mon, 21 Oct 2019 20:18:28 +0000 Received: from 187-26-105-39.3g.claro.net.br ([187.26.105.39] helo=quaco.ghostprotocols.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMe8I-0007Up-9G; Mon, 21 Oct 2019 20:18:26 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id AF2704035B; Mon, 21 Oct 2019 17:18:19 -0300 (-03) Date: Mon, 21 Oct 2019 17:18:19 -0300 From: Arnaldo Carvalho de Melo To: Mathieu Poirier Subject: Re: [PATCH] perf cs-etm: Fix definition of macro TO_CS_QUEUE_NR Message-ID: <20191021201819.GK1797@kernel.org> References: <20191021074808.25795-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.1 (2019-06-15) 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 , Suzuki K Poulose , Peter Zijlstra , Coresight ML , Linux Kernel Mailing List , Alexander Shishkin , Ingo Molnar , Leo Yan , Namhyung Kim , Jiri Olsa , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Mon, Oct 21, 2019 at 11:42:21AM -0600, Mathieu Poirier escreveu: > On Mon, 21 Oct 2019 at 01:48, Leo Yan wrote: > > > > Macro TO_CS_QUEUE_NR definition has a typo, which uses 'trace_id_chan' > > as its parameter, this doesn't match with its definition body which uses > > 'trace_chan_id'. So renames the parameter to 'trace_chan_id'. > > > > It's luck to have a local variable 'trace_chan_id' in the function > > cs_etm__setup_queue(), even we wrongly define the macro TO_CS_QUEUE_NR, > > the local variable 'trace_chan_id' is used rather than the macro's > > parameter 'trace_id_chan'; so the compiler doesn't complain for this > > before. > > > > After renaming the parameter, it leads to a compiling error due > > cs_etm__setup_queue() has no variable 'trace_id_chan'. This patch uses > > the variable 'trace_chan_id' for the macro so that fixes the compiling > > error. > > > > Signed-off-by: Leo Yan > > --- > > tools/perf/util/cs-etm.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > > index 4ba0f871f086..f5f855fff412 100644 > > --- a/tools/perf/util/cs-etm.c > > +++ b/tools/perf/util/cs-etm.c > > @@ -110,7 +110,7 @@ static int cs_etm__decode_data_block(struct cs_etm_queue *etmq); > > * encode the etm queue number as the upper 16 bit and the channel as > > * the lower 16 bit. > > */ > > -#define TO_CS_QUEUE_NR(queue_nr, trace_id_chan) \ > > +#define TO_CS_QUEUE_NR(queue_nr, trace_chan_id) \ > > (queue_nr << 16 | trace_chan_id) > > #define TO_QUEUE_NR(cs_queue_nr) (cs_queue_nr >> 16) > > #define TO_TRACE_CHAN_ID(cs_queue_nr) (cs_queue_nr & 0x0000ffff) > > @@ -819,7 +819,7 @@ static int cs_etm__setup_queue(struct cs_etm_auxtrace *etm, > > * Note that packets decoded above are still in the traceID's packet > > * queue and will be processed in cs_etm__process_queues(). > > */ > > - cs_queue_nr = TO_CS_QUEUE_NR(queue_nr, trace_id_chan); > > + cs_queue_nr = TO_CS_QUEUE_NR(queue_nr, trace_chan_id); > > ret = auxtrace_heap__add(&etm->heap, cs_queue_nr, timestamp); > > out: > > return ret; > > Really good catch - Arnaldo please consider. > > Reviewed-by: Mathieu Poirier Thanks, applied. - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel