From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17C34C4167B for ; Tue, 20 Dec 2022 10:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233639AbiLTKWl (ORCPT ); Tue, 20 Dec 2022 05:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233296AbiLTKWi (ORCPT ); Tue, 20 Dec 2022 05:22:38 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD3129FE9; Tue, 20 Dec 2022 02:22:37 -0800 (PST) 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 857892F4; Tue, 20 Dec 2022 02:23:18 -0800 (PST) Received: from [10.57.12.74] (unknown [10.57.12.74]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4A50E3F71A; Tue, 20 Dec 2022 02:22:34 -0800 (PST) Message-ID: <6f7291d7-ed3d-2ed2-654f-b8ba1a63cbad@arm.com> Date: Tue, 20 Dec 2022 10:22:32 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 1/4] perf event: Add simd_flags field to perf_sample Content-Language: en-US To: Namhyung Kim Cc: linux-perf-users@vger.kernel.org, robh@kernel.org, German Gomez , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , John Garry , Will Deacon , Mike Leach , Leo Yan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20221219161259.3097213-1-james.clark@arm.com> <20221219161259.3097213-2-james.clark@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/12/2022 18:21, Namhyung Kim wrote: > Hi James, > > On Mon, Dec 19, 2022 at 8:13 AM James Clark wrote: >> >> From: German Gomez >> >> Add new field to the struct perf_sample to store flags related to SIMD >> ops. >> >> It will be used to store SIMD information from SVE and NEON when >> profiling using ARM SPE. >> >> Signed-off-by: German Gomez >> Signed-off-by: James Clark >> --- >> tools/perf/util/sample.h | 13 +++++++++++++ >> 1 file changed, 13 insertions(+) >> >> diff --git a/tools/perf/util/sample.h b/tools/perf/util/sample.h >> index 60ec79d4eea4..bdf52faf165f 100644 >> --- a/tools/perf/util/sample.h >> +++ b/tools/perf/util/sample.h >> @@ -66,6 +66,18 @@ struct aux_sample { >> void *data; >> }; >> >> +struct simd_flags { >> + u64 arch:1, /* architecture (isa) */ >> + pred:2; /* predication */ > > Can we reserve more bits for possible future extension or > other arch support? It seems to be too tight for each field. > Do you plan to add more info to the struct in the future? As far as I can see because this is userspace only, reserving bits doesn't be done ahead of time. When we need more bits we can just add it. It never gets written to a file either so there is no need for backwards compatibility. > > Thanks, > Namhyung > > >> +}; >> + >> +/* simd architecture flags */ >> +#define SIMD_OP_FLAGS_ARCH_SVE 0x01 /* ARM SVE */ >> + >> +/* simd predicate flags */ >> +#define SIMD_OP_FLAGS_PRED_PARTIAL 0x01 /* partial predicate */ >> +#define SIMD_OP_FLAGS_PRED_EMPTY 0x02 /* empty predicate */ >> + >> struct perf_sample { >> u64 ip; >> u32 pid, tid; >> @@ -103,6 +115,7 @@ struct perf_sample { >> struct stack_dump user_stack; >> struct sample_read read; >> struct aux_sample aux_sample; >> + struct simd_flags simd_flags; >> }; >> >> /* >> -- >> 2.25.1 >>