Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1083906rdb; Wed, 16 Aug 2023 00:41:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPOIipyL4nrJXQf47sZPeLRUd0oe1UAXBfKeK2btV3KQs2QP43lL4I6jw/SY4rABOH12Ja X-Received: by 2002:a17:906:3017:b0:99d:ddae:f71c with SMTP id 23-20020a170906301700b0099dddaef71cmr732062ejz.51.1692171660321; Wed, 16 Aug 2023 00:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692171660; cv=none; d=google.com; s=arc-20160816; b=YZDltHXDlPo2jdnKf29cvbu5cVorC6VesCoza81A5d4UqOjRq2lBKblwjFmCZ8zsMH Zff7IpquFwMotSM87LZ+j5lwpadbmZUkG/sdssfCIs8/t4rNuqTb7xsCTtgxDaBcqwJO lR4CsmTlL3/UQKn18vUrhRNQYTL7c4GjlTFsLxsh7W0FreSDdR8EF5F2673AvIjew1zN dLkocEJIuztnyGr80neeinvlCMk+LX2BzLKItqxug9IUafSt6N2oxk0Pjog5G2n0+S7h Xk6J84t/emx5+wyhpg0JKtUk5pDM8J9DKq6F8hvVbzSoZ/H1V1izGRpvgxKrH/3LgeSY 3GHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/2r1fctjhWqnsAUqgQPedNYlhiYJ0uCJ0rPiazPrb0g=; fh=A0dAL/A4TKrdZ7bay3N7sYKwK3K5QWdGpJGytb9AQL0=; b=KWLcgmbw8d3HA8iWQOwpuM2uYOClQGx2bXINbFyjd5SwEGVVcxXC1z+31+vG5wTMjU 9cqLx4zl1MWmLDXcyQ/pGdl0bRRZyAvQQ6nDTEqhfEqdlTbf7BOvrZuGhNHdGgvRFKB0 VGvdV7vK75a3S3VljID3kgGk22Q5SQm929RPmJXxJ3eRE+ACueuwTW7WnvFFsnFFzol9 RFVMC4XewvnKIO+G27vDmTdUaeGz4YC6Kyq4qctA4rsnhG9aCXwHkvFM3opZKCrnAdym WlUAdv1GkWi2ZFacquFxI9tTsknH6h36YM6v9wISLtIVB5re2ISBuefcE9Enr9pCjIN+ 1gkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iVwgRhXK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk14-20020a170906c9ce00b0099bd554e682si9443282ejb.337.2023.08.16.00.40.35; Wed, 16 Aug 2023 00:41:00 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iVwgRhXK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238439AbjHOSJz (ORCPT + 99 others); Tue, 15 Aug 2023 14:09:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238264AbjHOSJk (ORCPT ); Tue, 15 Aug 2023 14:09:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF74E106; Tue, 15 Aug 2023 11:09:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 445CD653DD; Tue, 15 Aug 2023 18:09:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73F85C433C7; Tue, 15 Aug 2023 18:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692122978; bh=qKBDYXEsLAiqhhXTOyN5Rg5B1VHjDt+sAODeVHKcrY8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iVwgRhXKMByL5SSCpROf5pwdgD6EnlmgvA5wNbCdiI17Ywl7RhJCUod2OzRasc6Cu wrFVRJsB1akVw7TFbXBI8WN+bcb1BW16KLgQf8FAMBgFyx00WW4syQxZDxWQEyXtw0 NlS7DwREtJdM0UXoYYaBZLHpY46/Qh/k3yIXW7ApSSzsVPP1oxg1lQlzACXmxzvLA2 TkmzNhjeCgYJGyNjOB3Tn8e3By12hia6Bp0RGZkuWHgei4CJ8JvKwiCDRHI4hdGn0Z 5oO6ODIfyP/PDfvLduSDisU3EWOnHDAXYrAQuB+7Ddi9840T4Qk6ho9UqxUWwg90V1 M05PnPQbbuz8w== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0FB66404DF; Tue, 15 Aug 2023 15:09:36 -0300 (-03) Date: Tue, 15 Aug 2023 15:09:35 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: linux-perf-users@vger.kernel.org, irogers@google.com, john.g.garry@oracle.com, renyu.zj@linux.alibaba.com, Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , 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: Re: [PATCH v5 1/6] perf: cs-etm: Don't duplicate FIELD_GET() Message-ID: References: <20230811144017.491628-1-james.clark@arm.com> <20230811144017.491628-2-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230811144017.491628-2-james.clark@arm.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 Em Fri, Aug 11, 2023 at 03:39:18PM +0100, James Clark escreveu: > 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. Applied this one, to reduce the patch series size. - Arnaldo > 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 > -- - Arnaldo