From: German Gomez <german.gomez@arm.com>
To: Ali Saidi <alisaidi@amazon.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: benh@kernel.crashing.org, 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@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Leo Yan <leo.yan@linaro.org>, James Clark <james.clark@arm.com>,
Andrew Kilroy <andrew.kilroy@arm.com>
Subject: Re: [PATCH 1/2] perf arm-spe: Add arm_spe_record to synthesized sample
Date: Tue, 25 Jan 2022 20:47:39 +0000 [thread overview]
Message-ID: <5ca990a5-eedd-0edb-26d3-b5e16c36ac34@arm.com> (raw)
In-Reply-To: <20220125192016.20538-2-alisaidi@amazon.com>
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@amazon.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);
> }
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-01-25 20:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 19:20 [PATCH 0/2] Allow perf scripts to process SPE raw data Ali Saidi
2022-01-25 19:20 ` [PATCH 1/2] perf arm-spe: Add arm_spe_record to synthesized sample Ali Saidi
2022-01-25 20:47 ` German Gomez [this message]
2022-01-26 15:58 ` [PATCH 1/2] perf arm-spe: Add arm_spe_record to synthesized Ali Saidi
2022-01-26 19:07 ` German Gomez
2022-01-27 19:13 ` Ali Saidi
2022-01-25 19:20 ` [PATCH 2/2] perf arm-spe: Parse more SPE fields and store source Ali Saidi
2022-01-28 17:20 ` German Gomez
2022-01-28 21:02 ` Ali Saidi
2022-02-11 16:31 ` German Gomez
2022-02-12 4:19 ` Leo Yan
2022-02-21 20:41 ` German Gomez
2022-02-22 19:29 ` Ali Saidi
2022-02-25 12:40 ` German Gomez
2022-02-27 13:54 ` Leo Yan
2022-02-27 13:20 ` Leo Yan
2022-03-01 10:54 ` German Gomez
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=5ca990a5-eedd-0edb-26d3-b5e16c36ac34@arm.com \
--to=german.gomez@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alisaidi@amazon.com \
--cc=andrew.kilroy@arm.com \
--cc=benh@kernel.crashing.org \
--cc=james.clark@arm.com \
--cc=john.garry@huawei.com \
--cc=jolsa@redhat.com \
--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=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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).