From patchwork Mon Oct 21 07:48:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 177037 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3060290ill; Mon, 21 Oct 2019 00:48:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhTlVnbdfJJIO0YV6N5E4R3754egb/OaaIQxguiBxTcBWrHy+Yg6d7i5dwCkLtWcUV+FdQ X-Received: by 2002:a05:6402:2046:: with SMTP id bc6mr23917327edb.147.1571644110447; Mon, 21 Oct 2019 00:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571644110; cv=none; d=google.com; s=arc-20160816; b=acsgbsJZsv8HO5YEnxVT18ytYdma5mmxp0aEWfKhBvAg0K98pbPdl8ktZRptB7rdN5 AXxjkg/uCylscDXakUdp3LtUes9Ma6CWU6SWtV19bAiSU76INPDKux/mO/FdAv6FhZV0 bFReOw3SOsRxJzTOndzwIHyaG6LR28VR4VEWRXcrE3eHLXFEYhqh5aDIhQsMgN8ty5Wc vLP9qxePcEpXcubRTAd3IPxokQzHvRr1Z0OnEVEFyN6pwMiDMg3wLcPjD8RQwu/ssz8a lHinGwuI+KLiZsP0EQjzjl4fWw3z6tm/m8p3kgRCwb8GskU94wYA3f+U0uB+LGx+e+Cl TEcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=JxBBg9Ywns2KSENNzDozRimWLdlAzERjFMqNNveI+HE=; b=lKI02gGUfrzX3aQrzyKvXuDfLvaqOcHeUPk+R6O0osqynwId59oVwowqie5wVFED3o IA492SFHbRNx6E/YjWK178YFxYQroOqIfibnrBsupqD45Ba0bsuWkUQON2dHEDF1V7rO 1JE755gklGoHlyTS9kykqTxa1KxQ2A7+fpepMqz27i1EVX7ckR3LeOsiy+mUGVRQYPgU NkUYDrjWcsMr899KJsEyxWcAlCECF6j0gsdKs4dKCio0j+D2OqcsPh148CnPP9HWkJsj RM2yQcGabkS6oa8a0iRZD+E8OIhkKVJBB2grS5cPdZoXyWfzgcQY/NFABtdl8lw9Bt1P NU7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Whs5Oqw3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v16si8193853ejx.96.2019.10.21.00.48.30; Mon, 21 Oct 2019 00:48:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Whs5Oqw3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727497AbfJUHsZ (ORCPT + 26 others); Mon, 21 Oct 2019 03:48:25 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:36488 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbfJUHsZ (ORCPT ); Mon, 21 Oct 2019 03:48:25 -0400 Received: by mail-qk1-f196.google.com with SMTP id y189so11684989qkc.3 for ; Mon, 21 Oct 2019 00:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=JxBBg9Ywns2KSENNzDozRimWLdlAzERjFMqNNveI+HE=; b=Whs5Oqw3E1BNGGJx9IwRUe6mYoYJgqIDXMrLa69wGTimwenlmPnyxkdD96ImvDhgnz QNv9x87GEYuvI72Ufu+XBTd0z4tanRKZdRfzl7rAJYHLGZWm7umbbi1lICwM0bYbzlFi 1V6vJFo/vPS2wYYa/HaEhP0zxvJBmT63OA1/gMqCjtJNRWrCBxXpnTjkEAUqquUln5j0 +wPnClf9WTCtGcbTgdUSxzPkITq7gSqIX6gRERMY2f73wyc2hMZrBciki2PO3CEfmABL Bf1Mgm1iT1HyrJByLiYHMTlzHnDhnDKqvKFaqmjAGzkn8ctfXPELU1TpewmmBXF/b+X1 P3mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JxBBg9Ywns2KSENNzDozRimWLdlAzERjFMqNNveI+HE=; b=DRqbJn1kj4nu5X1u9+1XZwG9VFCvbtKoJzBxz8Wc9lu4iutXlMxGmtxnTQpx4l4/UN UrmQGT7kfysWG40Pt4PMaobWF6jBOtKpKYBCOcyf71e9o2yLOf5elqeJ9nskrvx5vaLg vrnFAQQ4we+OCXjTRAJghVU28AERR+2hNI16LkcfassEWqLWVjqImUkBWTEOzL5rRkOo PbzrIiWUpo5Q1kX+rdvrhPWJYZ6Kq+P7coCM8Gx0htJxWGCVdzPin9ihqcOhvwI6jD80 9KwMJVyBGV3l7eeohPY+DwpnY+PWfvTXJ+8gfqcNU5e+4Z0EZOHDIsrZz2q8yJu1c+ZT F0iQ== X-Gm-Message-State: APjAAAU5DqVymTYXEtQcKegvgRM4fj1BYafzPHd2wtcjXAd/h9BNThIF vejGM+ejkXtJ1oACO+Ggmn0Hyw== X-Received: by 2002:a37:af46:: with SMTP id y67mr21443431qke.84.1571644104467; Mon, 21 Oct 2019 00:48:24 -0700 (PDT) Received: from localhost.localdomain (li937-157.members.linode.com. [45.56.119.157]) by smtp.gmail.com with ESMTPSA id n17sm7980615qke.103.2019.10.21.00.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 00:48:23 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Coresight ML Cc: Leo Yan Subject: [PATCH] perf cs-etm: Fix definition of macro TO_CS_QUEUE_NR Date: Mon, 21 Oct 2019 15:48:08 +0800 Message-Id: <20191021074808.25795-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.1 Reviewed-by: Mathieu Poirier 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;