Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35378274rwd; Mon, 10 Jul 2023 06:43:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHaaXK6G1skgyh+v7iu+5vzvvB1ZlOfDD8+UGrLw6zN4JGIcNvMAAulNXDpK3mBqTjjDul2 X-Received: by 2002:a05:6a20:840d:b0:12f:bca:c2c6 with SMTP id c13-20020a056a20840d00b0012f0bcac2c6mr13022484pzd.35.1688996583342; Mon, 10 Jul 2023 06:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688996583; cv=none; d=google.com; s=arc-20160816; b=snCbvstlrdCL9B6hPWIIq7AeD+hRCZt1YLoha/lNldLSHL79vTcBZR3qjwsU9NUz9w fZQ33FJMQZD2UM0MORaCFCfh2iAk3/W/Mut79d8pckO6saKoA5Rb6IWHknOyaYcqnvws w0uohk44JFZQORJoDHtDjwEyhNFniWcGb951isz+kqHGwbwtoxoM+MesGDlzCaCcibKt x2X0yioDDtQoGqurWYLoaFZ+3RXg79C1//iB5NWFQZ0zyjndmFsuPBbJyceR6NVkJ7Bj bKBtbacNB+p2LH4+Nn0GgAVyhclJixaXdMyFJ/4iq4xAlJV9yeLCCUCXdWI/2nkXCwX0 4CaA== 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 :message-id:date:subject:cc:to:from; bh=WiEpmCUruzViw8kEX55FHMjCFqBIIoNsdRnD2qkZfdo=; fh=cThaliM0lLCoBxfwVd61pUW/GVwbiKVFeqShrEC124A=; b=USbIAlVqNRvWqimhyTJISvQhrOSIHtWc+YIA29Wzh8QxL/1JMpqP99I6BE8GXCJOJ5 qDXbTY5s553hm5Det8+4gIdSubviyysfBMLHmHADhC08k5D2QWrZHlNyXeZ0242Bdvz2 O2Rb98Cw1qYzTrm3LnXsiaGr+l3nRGu0v6jnZxS8Or3YW7Uc6wv6G6QLCJ6jtuUhu6c9 /lQXpgcpZ3K7HyYgmEY26BFbMt4ftoo/FmblxUpRxRdjoJF4RxuqyadNocCJrrjN9oc7 IQd/CGuCTpbI5HWFxpsWDvOi165lwK7Eq0Ja7d1B+GfghT5QDOZn1ZkrFb3FfgE0Gn3F qdiw== 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 q21-20020a63f955000000b00553c4551a09si3737098pgk.398.2023.07.10.06.42.50; Mon, 10 Jul 2023 06:43:03 -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 S232289AbjGJNbY (ORCPT + 99 others); Mon, 10 Jul 2023 09:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbjGJNbR (ORCPT ); Mon, 10 Jul 2023 09:31:17 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06B72F3; Mon, 10 Jul 2023 06:31:16 -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 D97FF2B; Mon, 10 Jul 2023 06:31:57 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.30.85]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BC4C43F67D; Mon, 10 Jul 2023 06:31:12 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com, renyu.zj@linux.alibaba.com, john.g.garry@oracle.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 , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: [PATCH 1/4] perf: cs-etm: Don't duplicate FIELD_GET() Date: Mon, 10 Jul 2023 14:30:52 +0100 Message-Id: <20230710133058.1483610-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 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,T_SCC_BODY_TEXT_LINE 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