perf: arm-spe: Fix check error when synthesizing events
PATCH 1/1 perf: arm-spe: Fix check error when synthesizing events
In arm_spe_read_record(), when we are processing an events packet, 'decoder->packet.index' is the length of payload, which has been transformed in payloadlen(). So correct the check of 'idx'.
--- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +3 -3
@@ -182,15 +182,15 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)if (payload &BIT (EV_TLB_ACCESS )) decoder->record.type |=ARM_SPE_TLB_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_MISS ))) decoder->record.type |=ARM_SPE_LLC_MISS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_ACCESS ))) decoder->record.type |=ARM_SPE_LLC_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_REMOTE_ACCESS ))) decoder->record.type |=ARM_SPE_REMOTE_ACCESS ;
Signature · 1 line
2.17.1
Hi Wei,
Quoted 5 lines · Wei Li
In
arm_spe_read_record(), when we are processing an events packet, 'decoder->packet.index' is the length of payload, which has been transformed inpayloadlen(). So correct the check of 'idx'.Signed-off-by Wei Li <[email protected]>
Good catch. I checked the ARMv8 ARM and the function payloadlen(), can confirm the fixing is correct.
Quoted 30 lines
--- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +3
-3@@ -182,15 +182,15 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)if (payload &BIT (EV_TLB_ACCESS )) decoder->record.type |=ARM_SPE_TLB_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_MISS ))) decoder->record.type |=ARM_SPE_LLC_MISS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_ACCESS ))) decoder->record.type |=ARM_SPE_LLC_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_REMOTE_ACCESS ))) decoder->record.type |=ARM_SPE_REMOTE_ACCESS ;Signature · 1 line
2.17.1
Ping...
Quoted 44 lines · Leo Yan
Hi Wei,
Quoted 5 lines · Wei Li
In
arm_spe_read_record(), when we are processing an events packet, 'decoder->packet.index' is the length of payload, which has been transformed inpayloadlen(). So correct the check of 'idx'.Signed-off-by Wei Li <[email protected]>Good catch. I checked the ARMv8 ARM and the function
payloadlen(), can confirm the fixing is correct.Reviewed-by Leo Yan <[email protected]>Quoted 30 lines
--- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +3
-3@@ -182,15 +182,15 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)if (payload &BIT (EV_TLB_ACCESS )) decoder->record.type |=ARM_SPE_TLB_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_MISS ))) decoder->record.type |=ARM_SPE_LLC_MISS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_ACCESS ))) decoder->record.type |=ARM_SPE_LLC_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_REMOTE_ACCESS ))) decoder->record.type |=ARM_SPE_REMOTE_ACCESS ;Signature · 1 line
2.17.1
Em Fri, Jul 24, 2020 at 04:32:18PM +0800, Leo Yan escreveu:
Quoted 7 lines
Hi Wei,
Quoted 4 lines · Wei Li
In
arm_spe_read_record(), when we are processing an events packet, 'decoder->packet.index' is the length of payload, which has been transformed inpayloadlen(). So correct the check of 'idx'.
Quoted 6 lines
Quoted 1 line
Signed-off-by Wei Li <[email protected]>Good catch. I checked the ARMv8 ARM and the function
payloadlen(), can confirm the fixing is correct.Reviewed-by Leo Yan <[email protected]>
Thanks, applied.
- Arnaldo
Quoted 30 lines
Quoted 30 lines
--- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/perf/util/arm-spe-decoder/arm-spe-decoder.c +3
-3@@ -182,15 +182,15 @@ static int arm_spe_read_record(struct arm_spe_decoder *decoder)if (payload &BIT (EV_TLB_ACCESS )) decoder->record.type |=ARM_SPE_TLB_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_MISS ))) decoder->record.type |=ARM_SPE_LLC_MISS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_LLC_ACCESS ))) decoder->record.type |=ARM_SPE_LLC_ACCESS ; -if ((idx ==1 || idx ==2 || idx ==3 ) && +if ((idx ==2 || idx ==4 || idx ==8 ) && (payload &BIT (EV_REMOTE_ACCESS ))) decoder->record.type |=ARM_SPE_REMOTE_ACCESS ;Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo