From: Wei Li <liwei391@huawei.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
James Clark <james.clark@arm.com>, Jiri Olsa <jolsa@redhat.com>,
Leo Yan <leo.yan@linaro.org>, Mark Rutland <mark.rutland@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Will Deacon <will@kernel.org>, <zhangshaokun@hisilicon.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, guohanjun@huawei.com
Subject: [PATCH 2/4] perf: arm-spe: Add support for ARMv8.3-SPE
Date: Fri, 24 Jul 2020 17:16:05 +0800 [thread overview]
Message-ID: <20200724091607.41903-3-liwei391@huawei.com> (raw)
In-Reply-To: <20200724091607.41903-1-liwei391@huawei.com>
Armv8.3 extends the SPE by adding:
- Alignment field in the Events packet, and filtering on this event
using PMSEVFR_EL1.
- Support for the Scalable Vector Extension (SVE).
The main additions for SVE are:
- Recording the vector length for SVE operations in the Operation Type
packet. It is not possible to filter on vector length.
- Incomplete predicate and empty predicate fields in the Events packet,
and filtering on these events using PMSEVFR_EL1.
Add the corresponding decode process of Events packet and Operation Type
packet in perf tool.
Signed-off-by: Wei Li <liwei391@huawei.com>
---
.../arm-spe-decoder/arm-spe-pkt-decoder.c | 69 ++++++++++++++++++-
1 file changed, 67 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
index b94001b756c7..10a3692839de 100644
--- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
+++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c
@@ -347,6 +347,24 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
blen -= ret;
}
}
+ if (idx > 2) {
+ if (payload & 0x800) {
+ ret = snprintf(buf, buf_len, " ALIGNMENT");
+ buf += ret;
+ blen -= ret;
+ }
+ if (payload & 0x20000) {
+ ret = snprintf(buf, buf_len, " SVE-PRED-PARTIAL");
+ buf += ret;
+ blen -= ret;
+ }
+ if (payload & 0x40000) {
+ ret = snprintf(buf, buf_len, " SVE-PRED-EMPTY");
+ buf += ret;
+ blen -= ret;
+ }
+ }
+
if (ret < 0)
return ret;
blen -= ret;
@@ -354,8 +372,38 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
}
case ARM_SPE_OP_TYPE:
switch (idx) {
- case 0: return snprintf(buf, buf_len, "%s", payload & 0x1 ?
- "COND-SELECT" : "INSN-OTHER");
+ case 0: {
+ if (payload & 0x8) {
+ size_t blen = buf_len;
+
+ ret = snprintf(buf, buf_len, "SVE-OTHER");
+ buf += ret;
+ blen -= ret;
+ if (payload & 0x2) {
+ ret = snprintf(buf, buf_len, " FP");
+ buf += ret;
+ blen -= ret;
+ }
+ if (payload & 0x4) {
+ ret = snprintf(buf, buf_len, " PRED");
+ buf += ret;
+ blen -= ret;
+ }
+ if (payload & 0x70) {
+ ret = snprintf(buf, buf_len, " EVL %d",
+ 32 << ((payload & 0x70) >> 4));
+ buf += ret;
+ blen -= ret;
+ }
+ if (ret < 0)
+ return ret;
+ blen -= ret;
+ return buf_len - blen;
+ } else {
+ return snprintf(buf, buf_len, "%s", payload & 0x1 ?
+ "COND-SELECT" : "INSN-OTHER");
+ }
+ }
case 1: {
size_t blen = buf_len;
@@ -385,6 +433,23 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
ret = snprintf(buf, buf_len, " SIMD-FP");
buf += ret;
blen -= ret;
+ } else if (payload & 0x8) {
+ if (payload & 0x4) {
+ ret = snprintf(buf, buf_len, " PRED");
+ buf += ret;
+ blen -= ret;
+ }
+ if (payload & 0x70) {
+ ret = snprintf(buf, buf_len, " EVL %d",
+ 32 << ((payload & 0x70) >> 4));
+ buf += ret;
+ blen -= ret;
+ }
+ if (payload & 0x80) {
+ ret = snprintf(buf, buf_len, " SG");
+ buf += ret;
+ blen -= ret;
+ }
}
if (ret < 0)
return ret;
--
2.17.1
_______________________________________________
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:[~2020-07-24 9:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 9:16 [PATCH 0/4] Add support for ARMv8.3-SPE Wei Li
2020-07-24 9:16 ` [PATCH 1/4] drivers/perf: " Wei Li
2020-07-28 12:27 ` Leo Yan
2020-07-28 13:24 ` liwei (GF)
2020-07-29 7:08 ` Leo Yan
2020-07-29 9:12 ` Suzuki K Poulose
2020-07-30 8:14 ` Leo Yan
2020-07-31 12:18 ` liwei (GF)
2020-07-31 14:01 ` Suzuki K Poulose
2020-09-07 12:51 ` Will Deacon
2020-09-29 8:17 ` liwei (GF)
2020-07-24 9:16 ` Wei Li [this message]
2020-07-29 6:29 ` [PATCH 2/4] perf: arm-spe: " Leo Yan
2020-07-29 7:21 ` liwei (GF)
2020-07-29 7:28 ` Leo Yan
2020-07-29 7:42 ` liwei (GF)
2020-08-17 15:04 ` Leo Yan
2020-07-24 9:16 ` [PATCH 3/4] perf auxtrace: Add new itrace options " Wei Li
2020-07-29 6:51 ` Leo Yan
2020-07-24 9:16 ` [PATCH 4/4] perf: arm-spe: Synthesize new events " Wei Li
2020-07-28 12:06 ` [PATCH 0/4] Add support " Arnaldo Carvalho de Melo
2020-07-28 12: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=20200724091607.41903-3-liwei391@huawei.com \
--to=liwei391@huawei.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=catalin.marinas@arm.com \
--cc=guohanjun@huawei.com \
--cc=james.clark@arm.com \
--cc=jolsa@redhat.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=zhangshaokun@hisilicon.com \
/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).