From: Leo Yan <leo.yan@arm.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
James Clark <james.clark@linaro.org>,
Mike Leach <mike.leach@linaro.org>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>, Jiri Olsa <jolsa@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] perf arm-spe: Define metadata header version 2
Date: Fri, 27 Sep 2024 09:05:36 +0100 [thread overview]
Message-ID: <f6a90906-6855-4524-9ff8-62099cbdb863@arm.com> (raw)
In-Reply-To: <ZvZRiTYrTOdXUVUk@google.com>
On 9/27/24 07:32, Namhyung Kim wrote:
[...]
>> diff --git a/tools/perf/util/arm-spe.h b/tools/perf/util/arm-spe.h
>> index 4f4900c18f3e..5416d4e1d15f 100644
>> --- a/tools/perf/util/arm-spe.h
>> +++ b/tools/perf/util/arm-spe.h
>> @@ -12,10 +12,46 @@
>> enum {
>> ARM_SPE_PMU_TYPE,
>> ARM_SPE_PER_CPU_MMAPS,
>> + ARM_SPE_AUXTRACE_V1_PRIV_MAX,
>> +};
>> +
>> +#define ARM_SPE_AUXTRACE_V1_PRIV_SIZE \
>> + (ARM_SPE_AUXTRACE_V1_PRIV_MAX * sizeof(u64))
>> +
>> +enum {
>> + /*
>> + * The old metadata format (defined above) does not include a
>> + * field for version number. Version 1 is reserved and starts
>> + * from version 2.
>> + */
>> + ARM_SPE_HEADER_VERSION,
>> + /* Number of sizeof(u64) */
>> + ARM_SPE_HEADER_SIZE,
>> + /* PMU type shared by CPUs */
>> + ARM_SPE_SHARED_PMU_TYPE,
>> + /* Number of CPUs */
>> + ARM_SPE_CPUS_NUM,
>> ARM_SPE_AUXTRACE_PRIV_MAX,
>> };
>
> Why don't you define something like struct arm_spe_header_v2 ?
Here the target is to make metadata to be self-described and can be
easily extended for new version (but I would not expect updating header
will happen frequently).
The fields ARM_SPE_HEADER_VERSION and ARM_SPE_HEADER_SIZE give a
header version and a header size. This allows us to easily extend new
enum items for new header. A benefit is we can use general code for
decoding because we don't need to process structure for a specific
version.
Thanks for review!
Leo
next prev parent reply other threads:[~2024-09-27 8:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 21:54 [PATCH v2 0/5] perf arm-spe: Introduce metadata version 2 Leo Yan
2024-09-14 21:54 ` [PATCH v2 1/5] perf arm-spe: Define metadata header " Leo Yan
2024-09-27 6:32 ` Namhyung Kim
2024-09-27 8:05 ` Leo Yan [this message]
2024-09-14 21:54 ` [PATCH v2 2/5] perf arm-spe: Calculate meta data size Leo Yan
2024-09-27 6:14 ` Namhyung Kim
2024-09-27 8:07 ` Leo Yan
2024-09-14 21:54 ` [PATCH v2 3/5] perf arm-spe: Save per CPU information in metadata Leo Yan
2024-09-27 6:21 ` Namhyung Kim
2024-09-27 8:16 ` Leo Yan
2024-09-14 21:54 ` [PATCH v2 4/5] perf arm-spe: Support metadata version 2 Leo Yan
2024-09-27 6:35 ` Namhyung Kim
2024-09-27 8:32 ` Leo Yan
2024-09-14 21:54 ` [PATCH v2 5/5] perf arm-spe: Dump metadata with " Leo Yan
2024-09-26 16:20 ` [PATCH v2 0/5] perf arm-spe: Introduce metadata " Leo Yan
2024-09-27 6:10 ` Namhyung Kim
2024-09-27 8:41 ` Leo Yan
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=f6a90906-6855-4524-9ff8-62099cbdb863@arm.com \
--to=leo.yan@arm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--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=namhyung@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).