All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: arm-spe: Fix check error when synthesizing events
@ 2020-07-24  7:26 Wei Li
  2020-07-24  8:32 ` Leo Yan
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Li @ 2020-07-24  7:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, James Clark, Mathieu Poirier, Leo Yan
  Cc: linux-kernel, Peter Zijlstra, Ingo Molnar, guohanjun

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'.

Signed-off-by: Wei Li <liwei391@huawei.com>
---
 tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
index 302a14d0aca9..93e063f22be5 100644
--- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
+++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
@@ -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;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: arm-spe: Fix check error when synthesizing events
  2020-07-24  7:26 [PATCH] perf: arm-spe: Fix check error when synthesizing events Wei Li
@ 2020-07-24  8:32 ` Leo Yan
  2020-08-18  3:45   ` liwei (GF)
  2020-08-20 12:28   ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 4+ messages in thread
From: Leo Yan @ 2020-07-24  8:32 UTC (permalink / raw)
  To: Wei Li
  Cc: Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, James Clark, Mathieu Poirier,
	linux-kernel, Peter Zijlstra, Ingo Molnar, guohanjun

Hi Wei,

On Fri, Jul 24, 2020 at 03:26:28PM +0800, Wei Li wrote:
> 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'.
>
> Signed-off-by: Wei Li <liwei391@huawei.com>

Good catch.  I checked the ARMv8 ARM and the function payloadlen(),
can confirm the fixing is correct.

Reviewed-by: Leo Yan <leo.yan@linaro.org>

> ---
>  tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
> index 302a14d0aca9..93e063f22be5 100644
> --- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
> @@ -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;
>  
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: arm-spe: Fix check error when synthesizing events
  2020-07-24  8:32 ` Leo Yan
@ 2020-08-18  3:45   ` liwei (GF)
  2020-08-20 12:28   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: liwei (GF) @ 2020-08-18  3:45 UTC (permalink / raw)
  To: Leo Yan
  Cc: Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, James Clark, Mathieu Poirier,
	linux-kernel, Peter Zijlstra, Ingo Molnar, guohanjun

Ping...

On 2020/7/24 16:32, Leo Yan wrote:
> Hi Wei,
> 
> On Fri, Jul 24, 2020 at 03:26:28PM +0800, Wei Li wrote:
>> 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'.
>>
>> Signed-off-by: Wei Li <liwei391@huawei.com>
> 
> Good catch.  I checked the ARMv8 ARM and the function payloadlen(),
> can confirm the fixing is correct.
> 
> Reviewed-by: Leo Yan <leo.yan@linaro.org>
> 
>> ---
>>  tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
>> index 302a14d0aca9..93e063f22be5 100644
>> --- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
>> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
>> @@ -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;
>>  
>> -- 
>> 2.17.1
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: arm-spe: Fix check error when synthesizing events
  2020-07-24  8:32 ` Leo Yan
  2020-08-18  3:45   ` liwei (GF)
@ 2020-08-20 12:28   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-08-20 12:28 UTC (permalink / raw)
  To: Leo Yan
  Cc: Wei Li, Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	James Clark, Mathieu Poirier, linux-kernel, Peter Zijlstra,
	Ingo Molnar, guohanjun

Em Fri, Jul 24, 2020 at 04:32:18PM +0800, Leo Yan escreveu:
> Hi Wei,
> 
> On Fri, Jul 24, 2020 at 03:26:28PM +0800, Wei Li wrote:
> > 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'.
> >
> > Signed-off-by: Wei Li <liwei391@huawei.com>
> 
> Good catch.  I checked the ARMv8 ARM and the function payloadlen(),
> can confirm the fixing is correct.
> 
> Reviewed-by: Leo Yan <leo.yan@linaro.org>

Thanks, applied.

- Arnaldo

> > ---
> >  tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
> > index 302a14d0aca9..93e063f22be5 100644
> > --- a/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
> > +++ b/tools/perf/util/arm-spe-decoder/arm-spe-decoder.c
> > @@ -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;
> >  
> > -- 
> > 2.17.1
> > 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-20 12:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-24  7:26 [PATCH] perf: arm-spe: Fix check error when synthesizing events Wei Li
2020-07-24  8:32 ` Leo Yan
2020-08-18  3:45   ` liwei (GF)
2020-08-20 12:28   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.