Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1062978rdg; Fri, 11 Aug 2023 08:34:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4BLIyUu1CcqO3KZc+e2dbMeUABFqM/xlC8SEfYMi4ey+8NQrCtDO3JT3K+unSxzNMiknk X-Received: by 2002:a17:907:77cb:b0:993:f744:d230 with SMTP id kz11-20020a17090777cb00b00993f744d230mr1924377ejc.16.1691768095111; Fri, 11 Aug 2023 08:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691768095; cv=none; d=google.com; s=arc-20160816; b=wL1KS3oYm/OeXXund2yi/qtJkzpqLPx2/MGBoutg+Vzi8IbR91dneY2n7a4fB8unch ELIOrV76SaK7o4a9UVRsxQZerG0XicAW3QzVP0OHAho4pnmkRrzfCDCHyEzYF07HxOuP Xf/RggWfTko8tgTdWU7ayf/S5wUUOtMzD7CyB5oMgHBS4ZemJ8uSeOJInVUVksprxl2d +wF1LcIYZ34avvxjhP9k5ADpRh12c2nxFutJmkMi5mmYVaknBVwWX4STovuNOS2dxH6L lOwbsXa6/ABMFTld/nfD5Hdgp3BK0KMZhGeNi5WXjNboclZgxsk4+OJg3PWm1fGfImju ACEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OCNiIv6U0AfxSzeAEBvrD0+EChHCWMc65T/ulixMyns=; fh=kDE8zQoZVXp99FhwtNApP6NE133sArTjPBxZZTzZ2sE=; b=RR1RahJl9JDgl3eXcgZNkwriRMnMXY8vIooP/6pqqa5VPGaMxVsTdW+Hnj4Qc+RUpb lIV6my7aRRmZuiph+//mgPmwtFuMqt32BFpRXte2145n18+584I7l3koGY9VJNd8RzwI kudwwZKhk1Dc1xCZVE/+XC0TtsO25Flq0v3up9AqVGpXmngtX5piYuHPrHCmYd0TjjEq qq7CcpBp7Wf4jPjkh1OV06cIl72kE8iG4teMnbyor7EPel8XlhJmXHbRWdaQtCTBqzGR u4YWQzVyxZuNibCLrRNcIeCBsuW0YtoT/55Xf3VerjA/qWHSe2WOC3f/LDCI89FDi5n+ SIqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lu5-20020a170906fac500b0098f99532db0si3434055ejb.660.2023.08.11.08.34.30; Fri, 11 Aug 2023 08:34:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235502AbjHKOlk (ORCPT + 99 others); Fri, 11 Aug 2023 10:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235646AbjHKOli (ORCPT ); Fri, 11 Aug 2023 10:41:38 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0CBA92D7F; Fri, 11 Aug 2023 07:41:38 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2EC7B113E; Fri, 11 Aug 2023 07:42:20 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 79B483F64C; Fri, 11 Aug 2023 07:41:34 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com, john.g.garry@oracle.com, renyu.zj@linux.alibaba.com Cc: James Clark , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Suzuki K Poulose , Kan Liang , Kajol Jain , Nick Forrington , Andrii Nakryiko , Eduard Zingerman , Sohom Datta , Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: [PATCH v5 1/6] perf: cs-etm: Don't duplicate FIELD_GET() Date: Fri, 11 Aug 2023 15:39:18 +0100 Message-Id: <20230811144017.491628-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230811144017.491628-1-james.clark@arm.com> References: <20230811144017.491628-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org linux/bitfield.h can be included as long as linux/kernel.h is included first, so change the order of the includes and drop the duplicate macro. Reviewed-by: John Garry Signed-off-by: James Clark --- tools/perf/util/cs-etm.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 1419b40dfbe8..9729d006550d 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -6,10 +6,11 @@ * Author: Mathieu Poirier */ +#include +#include #include #include #include -#include #include #include #include @@ -281,17 +282,6 @@ static int cs_etm__metadata_set_trace_id(u8 trace_chan_id, u64 *cpu_metadata) return 0; } -/* - * FIELD_GET (linux/bitfield.h) not available outside kernel code, - * and the header contains too many dependencies to just copy over, - * so roll our own based on the original - */ -#define __bf_shf(x) (__builtin_ffsll(x) - 1) -#define FIELD_GET(_mask, _reg) \ - ({ \ - (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \ - }) - /* * Get a metadata for a specific cpu from an array. * -- 2.34.1