Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1879245pxb; Fri, 5 Feb 2021 03:54:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBJot4SzBYPnUkHIHnId8VdE2kdxlC6Jam8yG6sUilF5cS7IP1x9XO0MYwyCjWiX4Yc8y8 X-Received: by 2002:a17:907:11c7:: with SMTP id va7mr3683689ejb.351.1612526059787; Fri, 05 Feb 2021 03:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612526059; cv=none; d=google.com; s=arc-20160816; b=fbBFheDe5N/TBM4VXFRVgWiJ0XGY/G7+Rhl8T6U7Q0nvgPAmz34oLU8G40+Z0X063J uiF+nrYXrIcFLHasr53aPPu5aZ9gSAmQyLKPDDk8y/dDguGsQ9NYC/QZ4DNdwLhywosV 0uwO58p5hLWEbYnNw5elmADrvLhzi6StXR9jgxN4Er287l6hVtLrJBYjv5+yXjI08TlG bkus2Ygyf5N952gnGHlkir8Ua3IgSWdEKYVrTupSWsjKgNZTWf11V5qiwSdtvijY3lMX WUJ9IJ2L3rvwHz/73bScs8u2Q4kk+IOH7Dh26HeFVGcYHXtCMUMbn4BNn26FVL/DtJH3 wiag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GFNCU2XU32iX8A3ILqgI9PR+yHagckvcg0FtnU2IeQ0=; b=K+8krth6Mpr9RRbkLZAYO6j3QX+hqW7irmg2iXHaE6bhc6DvzUGJWh1d54B6x31JUZ Nf6g0LhJjhngYaz55lj2o3IBpECjwXrBxeSlz4h2qIGFru1Co93Pmu/lYIUz508qbqar GivywBkyp/eu4lcAj8JAXdn2P+A33NT6Y6uDjZRRPfq35cujhEWUlncfF5HeiNs2l9Wl FNeCyRRrB7BpM+217MEGO6yMmNVZybgwV751b8gUYZKS7FzYx7Z7+0UGXDe+Bq4wJ7HE J5p8u3SU2fXjqeR4xoVGp8JL3RZN/M1c3cvkXjNTZarueSTyMVAe2OoZx5RM59P7d4No zrPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=heNRMYMQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id k27si4942177eje.568.2021.02.05.03.53.53; Fri, 05 Feb 2021 03:54:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=heNRMYMQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231367AbhBELun (ORCPT + 99 others); Fri, 5 Feb 2021 06:50:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231318AbhBELr4 (ORCPT ); Fri, 5 Feb 2021 06:47:56 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC310C0613D6 for ; Fri, 5 Feb 2021 03:47:15 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id t142so3613434wmt.1 for ; Fri, 05 Feb 2021 03:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GFNCU2XU32iX8A3ILqgI9PR+yHagckvcg0FtnU2IeQ0=; b=heNRMYMQh2iq8hWfyWyI0A9ZNKTpa+VYrgM2Z1v4prdmJfdVsJRzHUTrKH6bXQTUeS zG4Rk9iu2jGqlDZ8rWjAlI/n3I72I7X2xVeplLU56srzu6x4tkmwqpppFzRntHNvbf2/ xMj3Rfj4/5U8rv4kf5PhiMTaK38qu/wKYl7afff6wyqrGluQ+HtrPArKUgPVbTc0pMAv GyFW2MzggE8vfo6G2Cube5kDCg5hF3AbL6ux8hgevf4pc+QocTxowSQ6vRXDnYEWgzPv 54sjPsPvcV1M3xKu9jLdaLGZMMahtDmzlL8Pa09mNiX4jYahgbDhIXPG+WSHrJ8n+kHF fsBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GFNCU2XU32iX8A3ILqgI9PR+yHagckvcg0FtnU2IeQ0=; b=JkvwpIVyYtlUUyEOFzs06xG4/bYgoNaVq0q/iktnt0MuWQ2bk7Es6SEOvHmWXFJviu o34qgU3zkQBrfoNf8wQ/W3dipnuyG0OfyvbObh0sXpXakMUG5h8bL4bdiVS2tu8TRmN6 MM0i6nhgOAB+4CRnNjlh9z5dAr9ZlI7fV+JcgiW2qDMEU5I4YDhZ7WUrysev4OOuzDvh YIGJ5oFTGsjrljro/euA5iI/c+pz4PIoQ3MVCqW5WmwkGur7ya7KBsdIJn/XbERHYHsV 98oyJI72f6JM5xh713LmEd+EGC4FGy7fJACufN7KRBII8eDe/vocO/4IIP/jEBcn1S8m n8nQ== X-Gm-Message-State: AOAM533ANc7PEedQe18PKl/xteFzqPIXxuuQpF+cNmL4qDnSNfepnYHm VI2jrK2X2nPPRW9zmyc6AGhCUWuBxyWvGwH8mBpqjw== X-Received: by 2002:a7b:c856:: with SMTP id c22mr3351417wml.5.1612525634576; Fri, 05 Feb 2021 03:47:14 -0800 (PST) MIME-Version: 1.0 References: <20210202163842.134734-1-leo.yan@linaro.org> <20210202163842.134734-4-leo.yan@linaro.org> In-Reply-To: <20210202163842.134734-4-leo.yan@linaro.org> From: Mike Leach Date: Fri, 5 Feb 2021 11:47:04 +0000 Message-ID: Subject: Re: [PATCH v2 3/7] perf cs-etm: Fix bitmap for option To: Leo Yan Cc: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Jonathan Corbet , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , Coresight ML , linux-arm-kernel , "open list:DOCUMENTATION" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Feb 2021 at 16:39, 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] > 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 > Reivewed-by: Mike Leach -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK