Commit 03a6c16e authored by German Gomez's avatar German Gomez Committed by Arnaldo Carvalho de Melo

perf arm-spe: Add SVE flags to the SPE samples

Add flags from the Scalable Vector Extension (SVE) to the SPE samples
which are available from Armv8.3 (FEAT_SPEv1p1).

These will be displayed in a new SIMD sort field in a later commit.
Signed-off-by: default avatarGerman Gomez <german.gomez@arm.com>
Signed-off-by: default avatarJames Clark <james.clark@arm.com>
Acked-by: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20230320151509.1137462-2-james.clark@arm.com
Cc: Anshuman.Khandual@arm.com
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: John Garry <john.g.garry@oracle.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-perf-users@vger.kernel.org
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 0066015a
...@@ -273,6 +273,25 @@ static int arm_spe_set_tid(struct arm_spe_queue *speq, pid_t tid) ...@@ -273,6 +273,25 @@ static int arm_spe_set_tid(struct arm_spe_queue *speq, pid_t tid)
return 0; return 0;
} }
static struct simd_flags arm_spe__synth_simd_flags(const struct arm_spe_record *record)
{
struct simd_flags simd_flags = {};
if ((record->op & ARM_SPE_OP_LDST) && (record->op & ARM_SPE_OP_SVE_LDST))
simd_flags.arch |= SIMD_OP_FLAGS_ARCH_SVE;
if ((record->op & ARM_SPE_OP_OTHER) && (record->op & ARM_SPE_OP_SVE_OTHER))
simd_flags.arch |= SIMD_OP_FLAGS_ARCH_SVE;
if (record->type & ARM_SPE_SVE_PARTIAL_PRED)
simd_flags.pred |= SIMD_OP_FLAGS_PRED_PARTIAL;
if (record->type & ARM_SPE_SVE_EMPTY_PRED)
simd_flags.pred |= SIMD_OP_FLAGS_PRED_EMPTY;
return simd_flags;
}
static void arm_spe_prep_sample(struct arm_spe *spe, static void arm_spe_prep_sample(struct arm_spe *spe,
struct arm_spe_queue *speq, struct arm_spe_queue *speq,
union perf_event *event, union perf_event *event,
...@@ -289,6 +308,7 @@ static void arm_spe_prep_sample(struct arm_spe *spe, ...@@ -289,6 +308,7 @@ static void arm_spe_prep_sample(struct arm_spe *spe,
sample->tid = speq->tid; sample->tid = speq->tid;
sample->period = 1; sample->period = 1;
sample->cpu = speq->cpu; sample->cpu = speq->cpu;
sample->simd_flags = arm_spe__synth_simd_flags(record);
event->sample.header.type = PERF_RECORD_SAMPLE; event->sample.header.type = PERF_RECORD_SAMPLE;
event->sample.header.misc = sample->cpumode; event->sample.header.misc = sample->cpumode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment