Message ID | 20221219161259.3097213-2-james.clark@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2479142wrn; Mon, 19 Dec 2022 08:14:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf4x8tRQpR7k7U3x9t42SIgSB1Y0u4r0e+7M+VTkg8ZkRBifHUNInM72VI1Iz738IoM2fnqI X-Received: by 2002:a17:907:765a:b0:7c0:e305:a282 with SMTP id kj26-20020a170907765a00b007c0e305a282mr35677730ejc.59.1671466480165; Mon, 19 Dec 2022 08:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671466480; cv=none; d=google.com; s=arc-20160816; b=rMHvwiCx6wrRbzDc88NA6kSlkMtsrcmrJrtnAxwxFhl6am9M4E6vmdo19VOn2IY5lL sYQX6WClo2w8ogur5/FO5Q5jg5sT+CIdgYVeYsPwtdMIrDRud032TThgBfIKyIElDt0m LqOH3V0eBOjvwZUd4S6MTpf1Zb5tl6w2b6PhA/eXiwWS/2GdMiKyTTcm+5u9H8D74vMd HcS8p3H60+H0ejEbm0yRORzOapSSD3/cZOlr9yzFUPEmFWBDtPfl0Y70TPZ68c2OUE9C u5qRDwJtQQa98exmegYLxFAI6CBdYlwT8hrD5STZGwyAvbwfs2SIyTfabGAZZyM6m3CK RyTA== 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=NzZ3/HpbxuUwwZfA+UifL/rR8MKO79+fObnuN3HgMww=; b=F0C3u0BrNsLaxTqT0+7r+lQErGHbJn3RNGnbjAIABvyHAHm+yQY6str6ln6a77GW80 INJRA+6z6LdUiy1C96A0tkDwuIVMM5Lh4QPEC3QO92/plME+SThk3GD7gYhY77kxvAJD pR+d904WnRpWkR/uw9ov0HMYD3OFT++4eJbn6bFqb1ENl7p9ymWHbj/VeUyBTOQWznJr n63nETELx8jcXiY53id/7AE6imyztTGF3DqrUWo2YbElX2BLTMnA4nfPhyhcQag/qwRq PmYmHwzNaZAMKyPEJ9udfsSseg0Nh6JQGgA+yMcQNhIsvykEIc7fFqEwF9eocXkwDELq CyEA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf39-20020a1709077f2700b00813b319af0esi3734244ejc.110.2022.12.19.08.14.17; Mon, 19 Dec 2022 08:14:40 -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 S231702AbiLSQN6 (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Mon, 19 Dec 2022 11:13:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231344AbiLSQNz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 19 Dec 2022 11:13:55 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37A22DEA1; Mon, 19 Dec 2022 08:13:54 -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 BFCFBFEC; Mon, 19 Dec 2022 08:14:34 -0800 (PST) Received: from e126815.warwick.arm.com (e126815.arm.com [10.32.32.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8D78E3F703; Mon, 19 Dec 2022 08:13:51 -0800 (PST) From: James Clark <james.clark@arm.com> To: linux-perf-users@vger.kernel.org Cc: robh@kernel.org, German Gomez <german.gomez@arm.com>, James Clark <james.clark@arm.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] perf event: Add simd_flags field to perf_sample Date: Mon, 19 Dec 2022 16:12:55 +0000 Message-Id: <20221219161259.3097213-2-james.clark@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221219161259.3097213-1-james.clark@arm.com> References: <20221219161259.3097213-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752659635520668348?= X-GMAIL-MSGID: =?utf-8?q?1752659635520668348?= |
Series | Enable display of partial and empty SVE predicates from Arm SPE data | |
Commit Message
James Clark
Dec. 19, 2022, 4:12 p.m. UTC
From: German Gomez <german.gomez@arm.com> 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 <german.gomez@arm.com> Signed-off-by: James Clark <james.clark@arm.com> --- tools/perf/util/sample.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Comments
Hi James, On Mon, Dec 19, 2022 at 8:13 AM James Clark <james.clark@arm.com> wrote: > > From: German Gomez <german.gomez@arm.com> > > 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 <german.gomez@arm.com> > Signed-off-by: James Clark <james.clark@arm.com> > --- > 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? 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 >
On 19/12/2022 18:21, Namhyung Kim wrote: > Hi James, > > On Mon, Dec 19, 2022 at 8:13 AM James Clark <james.clark@arm.com> wrote: >> >> From: German Gomez <german.gomez@arm.com> >> >> 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 <german.gomez@arm.com> >> Signed-off-by: James Clark <james.clark@arm.com> >> --- >> 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 >>
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 */ +}; + +/* 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; }; /*