From: James Clark <james.clark@arm.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: linux-perf-users@vger.kernel.org, robh@kernel.org,
German Gomez <german.gomez@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>,
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: Re: [PATCH 1/4] perf event: Add simd_flags field to perf_sample
Date: Tue, 20 Dec 2022 10:22:32 +0000 [thread overview]
Message-ID: <6f7291d7-ed3d-2ed2-654f-b8ba1a63cbad@arm.com> (raw)
In-Reply-To: <CAM9d7chFXKTcD80dLkFLwQVT9M+k0oRSB5C7gXUXUS2OZ0UusQ@mail.gmail.com>
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
>>
next prev parent reply other threads:[~2022-12-20 10:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-19 16:12 [PATCH 0/4] Enable display of partial and empty SVE predicates from Arm SPE data James Clark
2022-12-19 16:12 ` [PATCH 1/4] perf event: Add simd_flags field to perf_sample James Clark
2022-12-19 18:21 ` Namhyung Kim
2022-12-20 10:22 ` James Clark [this message]
2022-12-19 16:12 ` [PATCH 2/4] perf arm-spe: Refactor arm-spe to support operation packet type James Clark
2022-12-19 16:12 ` [PATCH 3/4] perf arm-spe: Add SVE flags to the SPE samples James Clark
2022-12-19 16:12 ` [PATCH 4/4] perf report: Add 'simd' sort field James Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6f7291d7-ed3d-2ed2-654f-b8ba1a63cbad@arm.com \
--to=james.clark@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=german.gomez@arm.com \
--cc=john.g.garry@oracle.com \
--cc=jolsa@kernel.org \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mike.leach@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).