Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3920417rwj; Tue, 20 Dec 2022 03:53:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXtJT6aw0ysaebbLoRNqZEAhkVBugY0DVpGD4pxsaoCAyO/49FfJjJKJB5UpRnBymz+M9MGk X-Received: by 2002:a05:6a20:1604:b0:a7:16c4:d2c4 with SMTP id l4-20020a056a20160400b000a716c4d2c4mr21310223pzj.47.1671537217208; Tue, 20 Dec 2022 03:53:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671537217; cv=none; d=google.com; s=arc-20160816; b=Mfx3O0u3ZfU7lsjN07Ghh4KMFTcQWcWbWE1N/wdRS8K3Du6IbJ+7mfqkAt72Sb2gKo beP8MdH75Qc4NbwgJuY4Nx+SBf4YonM0UhDvltjP4Wjw/BfRJ/cLXUqk1KGqGkut58OU 9VK8Z7hFjEjSLmfklWyDQqhsBQmz3Y/tZl2RdrvaJ8TDpHNwf+nvS1c8Mj1lrV+BbEvj sf72R+rZi7DnTRu0KhHL0OFtEBcw0A8WFqB5FdO3oHk/QSUj9A+yBZ0CCHLpTjznstEe HTzsy6WRmtoRvHqa524Jx2YYVV9yFx0Ns8rT9mLiom5q29zomvt0MT+vp6kqMEY5GIO8 2aPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=rffaphA7K0pHZLDEaCLmAK88kg8f54sLwDa5jVU1GNE=; b=ZdRWBZOOXLmUU5FAn+U2qElCEBMkj3oF927WGlhdJCZQ93aMVsXBqs9/6KHAQvmuTJ avxECOltqR8ADytg6zx/SmfenSmKhBaQ0977YKzvRhX1m+Luq5I16A6U44JNgPKNnxFO d+/Z9tLLf7b4gzJUUAc3GvzWOgJCnQOHfU6a0jeJW1hNqSOlBhgJPkFm1AxjPhjHRzUO Vp/28LMMWfR7DpS812rsP+Xx9jpFhAnUhOAIL9obi2EFrVnS0rSAnZXwjszsweLUarmn NLyTMFKyokBWO4GHd5t5I2eO6PmGZkpMUM48dtBv2ViEH9bU6IxTD9eC3Ny+8vmoTdi3 AKDw== 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 x4-20020a63db44000000b004774d8c6191si14039893pgi.413.2022.12.20.03.53.27; Tue, 20 Dec 2022 03:53:37 -0800 (PST) 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 S233607AbiLTKWl (ORCPT + 70 others); 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 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 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 >>