Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36616217rwd; Tue, 11 Jul 2023 03:29:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFaUCY0YkAvDWqoCmCcHrk9R+GUERL6yIT20PJY1naYUjKshPV1Ja1whyPmtRukP6jPRcIk X-Received: by 2002:aa7:d045:0:b0:514:96f9:4f20 with SMTP id n5-20020aa7d045000000b0051496f94f20mr13217111edo.41.1689071399241; Tue, 11 Jul 2023 03:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689071399; cv=none; d=google.com; s=arc-20160816; b=xDeMnGQydZHyKUQbvd1B8mnYGzSwBbR3q9YuIHUjW1fRQtAPKZiUg1KKxIibk4I1UU oQRXiCsxfOzDFa1K4aY5nb9QopbLp2OB1OszRsrgf2lkq8ioOIfuXHMZBAFLuldSeCiZ XdndwLpDKmsl/32gxgKUAdSYz1L6z7Mb4HIVRzn7My5g7qUAKiUV8qm7k379QkfwZWcO 2+j+Nc76c1y1dRyj7I+1KR4d+TWdQBw9WpTNXG/YTpf6OwuW+vYGGdN17iW7YQPrCcmH ubVBkGdJ5CjymBHnUA3+whS8fCBdoEoKX1aar9iDzWhi1EPCgBVhUagwIvnnTHmWaNlH 655w== 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=awbz+y+xf2f7WyALpkAR1XeYuirvpjHJdxq/RVZ2EsM=; b=pX2eNhfaSInn3GkvNoALj1q4sv/99Hg5v+ohoJyU5ggfI5PEleIYrQk2p6R8ppVtcx pn433gWQMzzOrGF5YgEwmfOxOq6XwP0pWSuqDuUNo9PNrsimgMu4rt9gaPuv1CCZbIBb 1kVNf+CGKqIO5UjTbdn5v+12rVZ2W3f3oqjL6Qli7MisfJ+MWnQzbz09srKgRhRaDeis 71MOk7VEtp5kles6NSUJz7Qy0EIJxYBPCdbEoubRLFTLItlFntM4gDzSOOClmv5mR9Qi Xbl6ho4p8bHdAXrXF1q1qAtF3zayVffGDV82Qb3hLjpBu7ALvK/hpvy1YIq+7aCxckRw U43g== 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 c16-20020aa7c990000000b0051de7b55474si1878330edt.550.2023.07.11.03.29.34; Tue, 11 Jul 2023 03:29:59 -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 S229990AbjGKKCr (ORCPT + 99 others); Tue, 11 Jul 2023 06:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjGKKCm (ORCPT ); Tue, 11 Jul 2023 06:02:42 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B5A0FE; Tue, 11 Jul 2023 03:02:41 -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 EE44ED75; Tue, 11 Jul 2023 03:03:22 -0700 (PDT) Received: from e127643.arm.com (unknown [10.57.29.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 487F03F67D; Tue, 11 Jul 2023 03:02:37 -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: namhyung@kernel.org, acme@kernel.org, James Clark , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Suzuki K Poulose , Nick Forrington , Ilkka Koskinen , Kajol Jain , Thomas Richter , Kan Liang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org Subject: [PATCH v3 1/5] perf: cs-etm: Don't duplicate FIELD_GET() Date: Tue, 11 Jul 2023 11:02:11 +0100 Message-Id: <20230711100218.1651995-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711100218.1651995-1-james.clark@arm.com> References: <20230711100218.1651995-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,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