[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5ca990a5-eedd-0edb-26d3-b5e16c36ac34@arm.com>
Date: Tue, 25 Jan 2022 20:47:39 +0000
From: German Gomez <german.gomez@....com>
To: Ali Saidi <alisaidi@...zon.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Cc: benh@...nel.crashing.org, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
John Garry <john.garry@...wei.com>,
Will Deacon <will@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
James Clark <james.clark@....com>,
Andrew Kilroy <andrew.kilroy@....com>
Subject: Re: [PATCH 1/2] perf arm-spe: Add arm_spe_record to synthesized
sample
Hi Ali,
On 25/01/2022 19:20, Ali Saidi wrote:
> Providing the arm_spe_record as raw data to the synthesized SPE samples
> allows perf scripts to read and separately process the data in ways
> existing perf tools don't support and mirrors functionality available
> for PEBS.
> Signed-off-by: Ali Saidi <alisaidi@...zon.com>
> ---
> tools/perf/util/arm-spe.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
> index d2b64e3f588b..a7499cde6fc0 100644
> --- a/tools/perf/util/arm-spe.c
> +++ b/tools/perf/util/arm-spe.c
> @@ -336,6 +336,8 @@ static int arm_spe__synth_mem_sample(struct arm_spe_queue *speq,
> sample.phys_addr = record->phys_addr;
> sample.data_src = data_src;
> sample.weight = record->latency;
> + sample.raw_size = sizeof(*record);
> + sample.raw_data = record;
Have you tried this with perf-inject? I think it would need the PERF_SAMPLE_RAW bit in the sample_type,
Although I quickly looked over the perf inject code and it looks like it's expecting some type of padding:
// synthetic-events.c
if (type & PERF_SAMPLE_RAW) {
result += sizeof(u32);
result += sample->raw_size;
}
I'm seeing some comments in utils/event.h related to this on the intel events.
>
> return arm_spe_deliver_synth_event(spe, speq, event, &sample);
> }
> @@ -354,6 +356,8 @@ static int arm_spe__synth_branch_sample(struct arm_spe_queue *speq,
> sample.stream_id = spe_events_id;
> sample.addr = record->to_ip;
> sample.weight = record->latency;
> + sample.raw_size = sizeof(*record);
> + sample.raw_data = record;
>
> return arm_spe_deliver_synth_event(spe, speq, event, &sample);
> }
> @@ -383,6 +387,8 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
> sample.data_src = data_src;
> sample.period = spe->instructions_sample_period;
> sample.weight = record->latency;
> + sample.raw_size = sizeof(*record);
> + sample.raw_data = record;
>
> return arm_spe_deliver_synth_event(spe, speq, event, &sample);
> }
Powered by blists - more mailing lists