linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Clark <james.clark@linaro.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH 06/12] perf arm_spe: Add "events" entry in meta data
Date: Thu, 19 Jun 2025 16:46:16 +0100	[thread overview]
Message-ID: <86dbeae7-7219-4c6d-9ef9-38838bd088ce@linaro.org> (raw)
In-Reply-To: <20250613-arm_spe_support_hitm_overhead_v1_public-v1-6-6faecf0a8775@arm.com>



On 13/06/2025 4:53 pm, Leo Yan wrote:
> Add a new "events" entry in the meta data and dump it in raw data mode.
> 
> After:
> 
>    # perf script -D
>    ...
> 
>    0 0 0x470 [0x1f0]: PERF_RECORD_AUXTRACE_INFO type: 4
>      Header version     :2
>      Header size        :4
>      PMU type v2        :11
>      CPU number         :8
>        Magic            :0x1010101010101010
>        CPU #            :0
>        Num of params    :4
>        MIDR             :0x410fd0f0
>        PMU Type         :11
>        Min Interval     :256
>        Events           :0xffff000003fefffe
> 

Pending possibly renaming this field on patch 2

Reviewed-by: James Clark <james.clark@linaro.org>


>    ...
> 
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
>   tools/perf/arch/arm64/util/arm-spe.c | 5 +++++
>   tools/perf/util/arm-spe.c            | 1 +
>   tools/perf/util/arm-spe.h            | 2 ++
>   3 files changed, 8 insertions(+)
> 
> diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
> index 4f2833b62ff55f3fd1dff3f032d6e06528460939..5cce5f29d8c7936cc4f424a09d50536644c17be9 100644
> --- a/tools/perf/arch/arm64/util/arm-spe.c
> +++ b/tools/perf/arch/arm64/util/arm-spe.c
> @@ -121,12 +121,17 @@ static int arm_spe_save_cpu_header(struct auxtrace_record *itr,
>   		/* No Arm SPE PMU is found */
>   		data[ARM_SPE_CPU_PMU_TYPE] = ULLONG_MAX;
>   		data[ARM_SPE_CAP_MIN_IVAL] = 0;
> +		data[ARM_SPE_CAP_EVENTS] = 0;
>   	} else {
>   		data[ARM_SPE_CPU_PMU_TYPE] = pmu->type;
>   
>   		if (perf_pmu__scan_file(pmu, "caps/min_interval", "%lu", &val) != 1)
>   			val = 0;
>   		data[ARM_SPE_CAP_MIN_IVAL] = val;
> +
> +		if (perf_pmu__scan_file(pmu, "caps/events", "%lu", &val) != 1)
> +			val = 0;
> +		data[ARM_SPE_CAP_EVENTS] = val;
>   	}
>   
>   	free(cpuid);
> diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
> index fdef6f743cf3c76b1dcdd57f5a2c297642fdd21a..55b8391990467c8b7818bb63de3545d94d021bb7 100644
> --- a/tools/perf/util/arm-spe.c
> +++ b/tools/perf/util/arm-spe.c
> @@ -1532,6 +1532,7 @@ static const char * const metadata_per_cpu_fmts[] = {
>   	[ARM_SPE_CPU_MIDR]		= "    MIDR             :0x%"PRIx64"\n",
>   	[ARM_SPE_CPU_PMU_TYPE]		= "    PMU Type         :%"PRId64"\n",
>   	[ARM_SPE_CAP_MIN_IVAL]		= "    Min Interval     :%"PRId64"\n",
> +	[ARM_SPE_CAP_EVENTS]		= "    Events           :0x%"PRIx64"\n",
>   };
>   
>   static void arm_spe_print_info(struct arm_spe *spe, __u64 *arr)
> diff --git a/tools/perf/util/arm-spe.h b/tools/perf/util/arm-spe.h
> index 390679a4af2fb61419bc881b5dc43c01f1dd77d7..a47d3d8fc97e07d1bb41a6776133d0676c335613 100644
> --- a/tools/perf/util/arm-spe.h
> +++ b/tools/perf/util/arm-spe.h
> @@ -47,6 +47,8 @@ enum {
>   	ARM_SPE_CPU_PMU_TYPE,
>   	/* Minimal interval */
>   	ARM_SPE_CAP_MIN_IVAL,
> +	/* Supported events */
> +	ARM_SPE_CAP_EVENTS,
>   	ARM_SPE_CPU_PRIV_MAX,
>   };
>   
> 


  reply	other threads:[~2025-06-19 15:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 15:53 [PATCH 00/12] perf arm-spe: Support new events in FEAT_SPEv1p4 Leo Yan
2025-06-13 15:53 ` [PATCH 01/12] drivers/perf: arm_spe: Store event reserved bits in driver data Leo Yan
2025-06-19 11:28   ` James Clark
2025-06-19 16:22     ` Leo Yan
2025-06-13 15:53 ` [PATCH 02/12] drivers/perf: arm_spe: Expose events capability Leo Yan
2025-06-19 11:32   ` James Clark
2025-06-19 16:24     ` Leo Yan
2025-06-13 15:53 ` [PATCH 03/12] perf arm_spe: Correct setting remote access Leo Yan
2025-06-19 13:53   ` James Clark
2025-06-19 16:45     ` Leo Yan
2025-06-13 15:53 ` [PATCH 04/12] perf arm_spe: Directly propagate raw event Leo Yan
2025-06-19 14:13   ` James Clark
2025-06-13 15:53 ` [PATCH 05/12] perf arm_spe: Decode event types for new features Leo Yan
2025-06-19 14:20   ` James Clark
2025-06-13 15:53 ` [PATCH 06/12] perf arm_spe: Add "events" entry in meta data Leo Yan
2025-06-19 15:46   ` James Clark [this message]
2025-06-13 15:53 ` [PATCH 07/12] perf arm_spe: Refine memory level filling Leo Yan
2025-06-20 10:27   ` James Clark
2025-06-13 15:53 ` [PATCH 08/12] perf arm_spe: Separate setting of memory levels for loads and stores Leo Yan
2025-06-20 10:30   ` James Clark
2025-06-13 15:53 ` [PATCH 09/12] perf arm_spe: Fill memory levels for FEAT_SPEv1p4 Leo Yan
2025-06-20 10:37   ` James Clark
2025-06-13 15:53 ` [PATCH 10/12] perf arm_spe: Refactor arm_spe__get_metadata_by_cpu() Leo Yan
2025-06-20 10:45   ` James Clark
2025-06-13 15:53 ` [PATCH 11/12] perf arm_spe: Set HITM flag Leo Yan
2025-06-20 10:51   ` James Clark
2025-06-13 15:53 ` [PATCH 12/12] perf arm_spe: Allow parsing both data source and events Leo Yan
2025-06-20 10:55   ` 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=86dbeae7-7219-4c6d-9ef9-38838bd088ce@linaro.org \
    --to=james.clark@linaro.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --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).