Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3102205rwb; Mon, 7 Aug 2023 08:16:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF14o9KOkg/2W/SJbEZ4rvrumcfeFQ9HBTgVECFDmhQHvc7STYV0a8qfol3X88O2u6tTjfm X-Received: by 2002:a17:902:694b:b0:1ae:8892:7d27 with SMTP id k11-20020a170902694b00b001ae88927d27mr9819268plt.42.1691421402532; Mon, 07 Aug 2023 08:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691421402; cv=none; d=google.com; s=arc-20160816; b=EmeTAiYwQls1/by7m+WLOaBeRV9xAYqnhENAyMcYiEf7QJhFOz0MuoZXtL+D/cm1v1 CzePbR0hZ9s6q7Espzo5XI8rKkEjKP+KVUDjG70NbPQXrWHiLTaMmpLrddpQHFGTiPYI M/xRchFsFCiBMmr6ssnOEccGiW/jJHyesdASOhsRsjd5meObKKr9Z6sw4NRrLCCpEHzk zfbySxS6/yp7F8GVo25ZVkyVeaCcvYQZ4H8QkZcKGO5xzo2hJOSanOQ/b3J7Y23hfXR4 pWlbuUeA2ov855A8WyYfDDmkzbnUzyO5hVurvWHrZKkOyYGgQJYVS2Qju8qo4s5RKwNc eFQw== 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=WiEpmCUruzViw8kEX55FHMjCFqBIIoNsdRnD2qkZfdo=; fh=oDU8Pc4+R2wj11rKo7aEM+pOPsjB1pNjm32VOscFVcA=; b=x2asfV7gloCYXLQOhVgk3DnPKZSZ4AQaH0gVwZ4MCdcR5O7bkx6bDW2nvQ0KyX+Xwz zagO3KwtDVbryLqMj88AX62z00G6UlUWUyRS2GiocFjtKJLOoBA0F4HfG2k9WPIPziQm jA9Lad+nOQi037LqPRxc76IGPrCnB7uAiAwMZ6VAYvk9Fa1Tnbr46zwso1uwbYl7lxrn Np2VGskc4AH+ZqVS66Ycmn9oQHgHA9SRAaOUdq3wQSEEzFQO8DK6pmyh9uY0R0yH8NSP BGymZ/6gpdiAmq+LU68we7uxdhdGB3g1iSQJtMb2W3tTaUp3gXDruDwKezBgvWNaHC4Q tP1g== 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 s2-20020a170902c64200b001bbfa153483si5739999pls.418.2023.08.07.08.16.30; Mon, 07 Aug 2023 08:16:42 -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 S231340AbjHGOXD (ORCPT + 99 others); Mon, 7 Aug 2023 10:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233518AbjHGOWx (ORCPT ); Mon, 7 Aug 2023 10:22:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2E09C2; Mon, 7 Aug 2023 07:22:52 -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 7B6E71FB; Mon, 7 Aug 2023 07:23:35 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 711BD3F64C; Mon, 7 Aug 2023 07:22:49 -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 , Eduard Zingerman , Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: [PATCH v4 1/6] perf: cs-etm: Don't duplicate FIELD_GET() Date: Mon, 7 Aug 2023 15:20:45 +0100 Message-Id: <20230807142138.288713-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807142138.288713-1-james.clark@arm.com> References: <20230807142138.288713-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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. 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