From patchwork Wed Dec 15 15:11:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: German Gomez X-Patchwork-Id: 12696283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E8C8C433F5 for ; Wed, 15 Dec 2021 15:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HU75/gRzoqZVlnAQN3fUtlk2W4agfBHlwxhEV2mJHLY=; b=1Ymk/FyxWZuOpV p9Ze4HyS2Y/klJnWy5WhKmICaiNqrl2/99tA2JpFA7nOX7TerXDSzAD1R9tFT/VujnczdTJ76RZU4 3AAP/SyJd63XYQFPIUoUZUIhMSAmHyZC54CK9ZK+B10Tru17v/D7SgXj12VXQ7jL0Aj4As8tpAXIn QoIKCH4H4MktOVH8OGhpYITw5oHBLCTw5mCI/GDaUuB8cDLHZM0Gk/xbGVGditVO/bP3nywsjg83U eVPFCmDx7lYpmXk/xc27jpeun8MUlSfGNkRjHnjOPBH+mb7fk4qnUY5D2zs1zmbfGrGorCEt/E4e4 ww90pTawp70zTaybvQGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxVxi-001Hv9-V4; Wed, 15 Dec 2021 15:12:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxVx8-001HeB-0X for linux-arm-kernel@lists.infradead.org; Wed, 15 Dec 2021 15:12:23 +0000 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 310D01435; Wed, 15 Dec 2021 07:12:21 -0800 (PST) Received: from ip-10-252-15-108.eu-west-1.compute.internal (unknown [10.252.15.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 18F2B3F774; Wed, 15 Dec 2021 07:12:18 -0800 (PST) From: German Gomez To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org Cc: German Gomez , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 5/6] perf tools: Refactor SMPL_REG macro in perf_regs.h Date: Wed, 15 Dec 2021 15:11:37 +0000 Message-Id: <20211215151139.40854-6-german.gomez@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215151139.40854-1-german.gomez@arm.com> References: <20211215151139.40854-1-german.gomez@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211215_071222_127937_E4D1620A X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Refactor the SAMPL_REG macro so that it can be used in a followup commit to obtain the masks for ARM64 registers. Signed-off-by: German Gomez --- tools/perf/util/perf_regs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h index 4e6b1299c571..ce1127af05e4 100644 --- a/tools/perf/util/perf_regs.h +++ b/tools/perf/util/perf_regs.h @@ -11,8 +11,11 @@ struct sample_reg { const char *name; uint64_t mask; }; -#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) } -#define SMPL_REG2(n, b) { .name = #n, .mask = 3ULL << (b) } + +#define SMPL_REG_MASK(b) (1ULL << (b)) +#define SMPL_REG(n, b) { .name = #n, .mask = SMPL_REG_MASK(b) } +#define SMPL_REG2_MASK(b) (3ULL << (b)) +#define SMPL_REG2(n, b) { .name = #n, .mask = SMPL_REG2_MASK(b) } #define SMPL_REG_END { .name = NULL } enum {