[PATCH 05/25] perf arm_spe: Decode ASE and FP fields in other operation

James Clark james.clark at linaro.org
Thu Oct 9 02:06:34 PDT 2025



On 09/10/2025 10:04 am, James Clark wrote:
> 
> 
> On 29/09/2025 5:37 pm, Leo Yan wrote:
>> Add a check for other operation, which prevents any incorrectly
>> classifying. Parse the ASE and FP fields.
>>
>> After:
>>
>>    .  0000002f:  48 06                                           OTHER 
>> ASE FP INSN-OTHER
>>    .  00000031:  b2 08 80 48 01 08 00 ff ff                      VA 
>> 0xffff000801488008
>>    .  0000003a:  9a 00 00                                        LAT 0 
>> XLAT
>>    .  0000003d:  42 16                                           EV 
>> RETIRED L1D-ACCESS TLB-ACCESS
>>
>> Signed-off-by: Leo Yan <leo.yan at arm.com>
>> ---
>>   tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 +++++-
>>   tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 4 ++++
>>   2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> 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 
>> 533920b738cbcb39136d1ba3d88e99f9d8009e74..21b65a9b40f481b6cb25aaf01ab627ade046ff72 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
>> @@ -351,8 +351,12 @@ static int arm_spe_pkt_desc_op_type(const struct 
>> arm_spe_pkt *packet,
>>                   arm_spe_pkt_out_string(&err, &buf, &buf_len, " FP");
>>               if (payload & SPE_OP_PKT_SVE_PRED)
>>                   arm_spe_pkt_out_string(&err, &buf, &buf_len, " PRED");
>> -        } else {
>> +        } else if (SPE_OP_PKT_OTHER_SUBCLASS_OTHER(payload)) {
>>               arm_spe_pkt_out_string(&err, &buf, &buf_len, "OTHER");
>> +            if (payload & SPE_OP_PKT_OTHER_ASE)
>> +                arm_spe_pkt_out_string(&err, &buf, &buf_len, " ASE");
>> +            if (payload & SPE_OP_PKT_OTHER_FP)
>> +                arm_spe_pkt_out_string(&err, &buf, &buf_len, " FP");
>>               arm_spe_pkt_out_string(&err, &buf, &buf_len, " %s",
>>                              payload & SPE_OP_PKT_COND ?
>>                              "COND-SELECT" : "INSN-OTHER");
> 
> A warning for unknown packet type would be useful here now that there is 
> no final else catch-all.
> 

Although I see it's consistent with other cases now. Maybe it could be a 
later fix to add unknown packet type warnings for all cases.

>> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h b/ 
>> tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
>> index 
>> 48bd9e9ef132b11b79ffe2e2fbc7cfe4c340ff92..704601c6dbe30e93f83a82670d0d60344a22222a 100644
>> --- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
>> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h
>> @@ -123,8 +123,12 @@ enum arm_spe_events {
>>   #define SPE_OP_PKT_HDR_CLASS_LD_ST_ATOMIC    0x1
>>   #define SPE_OP_PKT_HDR_CLASS_BR_ERET        0x2
>> +#define SPE_OP_PKT_OTHER_SUBCLASS_OTHER(v)    (((v) & GENMASK_ULL(7, 
>> 3)) == 0x0)
>>   #define SPE_OP_PKT_OTHER_SUBCLASS_SVE(v)    (((v) & (BIT(7) | BIT(3) 
>> | BIT(0))) == 0x8)
>> +#define SPE_OP_PKT_OTHER_ASE            BIT(2)
>> +#define SPE_OP_PKT_OTHER_FP            BIT(1)
>> +
>>   #define SPE_OP_PKT_LDST_SUBCLASS_GP_REG(v)    (((v) & GENMASK_ULL(7, 
>> 1)) == 0x0)
>>   #define SPE_OP_PKT_LDST_SUBCLASS_SIMD_FP(v)    (((v) & 
>> GENMASK_ULL(7, 1)) == 0x4)
>>   #define SPE_OP_PKT_LDST_SUBCLASS_UNSPEC_REG(v)    (((v) & 
>> GENMASK_ULL(7, 1)) == 0x10)
>>
> 




More information about the linux-arm-kernel mailing list