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=-17.1 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, USER_AGENT_GIT 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 491F6C433DB for ; Tue, 2 Feb 2021 16:40:37 +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 045E564F54 for ; Tue, 2 Feb 2021 16:40:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 045E564F54 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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=diRFbMiiNArFiVyHDgSabbZX1wTRNgy/jhvS82qxp8U=; b=wOGvlCrlXgQjXJtQ6S3E7x56X tbXr2DGcQPV0u27WTUdUcalR+YKebxlZMV1eIXeSbkk/Xq8coSkeekihTqjFaTmXhdqLk+Z7uWexQ Pzb5A4hyGxBOa2gamvvZVu847SF3DPnypVW+dr1riUU2gX1o/UP1t2M6zZAIBbgA0VmzThheZr6aa 3QoDhQg58LyfpZvO1V0NyABj3uqFpYkGtNLAz/SN2yLl5NA3zrw26zQdD53pKBG/dDqrBo7IKt5jd 6YydQ0ZlGNNlwn19z7B3YSFhZTOdJ6rJ/WVX6Zm2KF0sfnV4BXaMA75tLob0EgGqmogov7jv9Z3sb XJe2E30ZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6yi6-0006Be-Oe; Tue, 02 Feb 2021 16:39:26 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6yhz-00068r-3x for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 16:39:20 +0000 Received: by mail-pg1-x52e.google.com with SMTP id j2so13589851pgl.0 for ; Tue, 02 Feb 2021 08:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CFdPZ29w2xwH6QzN+c2d/PUiDMRAiYL/DxdkhsE38Vw=; b=UyL3T6EbSC1C8Q2rt6EMnLI9SICMZ0JlqENLHs+JcpsFDf/OfZtZ3OIi6App5/kPbr 7xRb9XxedOjpoVFhKKqG/kUIENOqa1xtP2oOKXtevFtjI8+Z3uZDuXy9uIhRyxyWD7U2 YLeiihRm0vya1Qvf13eKiONK+UmGnP8vD8PLyTg1jjtfiZGZOj+JtTavDcv5Kq6Geh8m eZLNiGOKnNkaz1nadcI8zQ0jY6PDcCF/7hSgU2u8/mx3C1/cTdfhYeQITN5sy4H1zZXs 7h4zb2+uWU2IpoK7baF/dON6qtp2X0mupTBPje+u2wiuUps54+oxVKvARJsUXUTccgqN iEzA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=CFdPZ29w2xwH6QzN+c2d/PUiDMRAiYL/DxdkhsE38Vw=; b=FKjlfSxobaak3WafsLpNayb8Q01p7wk59fp6dkqo6eTeXOoSRRMCI1Pgqwo5jDx1EP M87ZegremWRJGVnleaFer5fxzeCUA4jjc3Uhees234r71slfzWLc5nrwKaLGXHcTCuv8 4pkKrk2Yl1NuldMgxf25KPlalUPjyVSnus/LPdcC7VTaftf0AqgVq8JBRivf3E2URBVF 5HVsKLkeLSysHrxeiBB6OnRTLD9d2koDaL/LSV/sv+jorFZtoDfqdl/0F49xq9GjzMIL 46pH/+kfBw6S5POJYMZCgy7U+JlsmlnZOPCFmKVqQjvbT7PGmrl7sTlAOGKGmhy+zzkf /PgQ== X-Gm-Message-State: AOAM532Teb10nkWkyuEAyGE39BF/vREqZfpyfoOHW8o3QniRExfiB0rI uYcph0R+323tZO0eaCPvSkENXg== X-Google-Smtp-Source: ABdhPJx82MyntuaE9MkO6TG9T/KZW9O2xzn/2CIWSRhrtnmVVJ0rg72Mc73Q66LiK/rQDmU7Djgriw== X-Received: by 2002:a63:4f09:: with SMTP id d9mr23201993pgb.70.1612283957164; Tue, 02 Feb 2021 08:39:17 -0800 (PST) Received: from localhost ([45.137.216.202]) by smtp.gmail.com with ESMTPSA id x186sm21996440pfd.57.2021.02.02.08.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 08:39:16 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , 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 Subject: [PATCH v2 3/7] perf cs-etm: Fix bitmap for option Date: Wed, 3 Feb 2021 00:38:38 +0800 Message-Id: <20210202163842.134734-4-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210202163842.134734-1-leo.yan@linaro.org> References: <20210202163842.134734-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_113919_211868_ACDECD8C X-CRM114-Status: GOOD ( 15.59 ) 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: Leo Yan 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 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] Signed-off-by: Suzuki K Poulose Signed-off-by: Leo Yan --- 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) + 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