[PATCH] selftests/powerpc: Purge extra count_pmc() calls of ebb selftests

Desnes Augusto Nunes do Rosario desnesn at linux.ibm.com
Wed Jul 8 22:52:06 AEST 2020


On 7/8/20 7:38 AM, Sachin Sant wrote:
>
>> On 26-Jun-2020, at 10:17 PM, Desnes A. Nunes do Rosario <desnesn at linux.ibm.com> wrote:
>>
>> An extra count on ebb_state.stats.pmc_count[PMC_INDEX(pmc)] is being per-
>> formed when count_pmc() is used to reset PMCs on a few selftests. This
>> extra pmc_count can occasionally invalidate results, such as the ones from
>> cycles_test shown hereafter. The ebb_check_count() failed with an above
>> the upper limit error due to the extra value on ebb_state.stats.pmc_count.
>>
>> Furthermore, this extra count is also indicated by extra PMC1 trace_log on
>> the output of the cycle test (as well as on pmc56_overflow_test):
>>
>> ==========
>>    ...
>>    [21]: counter = 8
>>    [22]: register SPRN_MMCR0 = 0x0000000080000080
>>    [23]: register SPRN_PMC1  = 0x0000000080000004
>>    [24]: counter = 9
>>    [25]: register SPRN_MMCR0 = 0x0000000080000080
>>    [26]: register SPRN_PMC1  = 0x0000000080000004
>>    [27]: counter = 10
>>    [28]: register SPRN_MMCR0 = 0x0000000080000080
>>    [29]: register SPRN_PMC1  = 0x0000000080000004
>>>> [30]: register SPRN_PMC1  = 0x000000004000051e
>> PMC1 count (0x280000546) above upper limit 0x2800003e8 (+0x15e)
>> [FAIL] Test FAILED on line 52
>> failure: cycles
>> ==========
>>
>> Signed-off-by: Desnes A. Nunes do Rosario <desnesn at linux.ibm.com>
>> ---
> I too have run into similar failure with cycles_test. I will add that the failure
> is inconsistent. I have run into this issue 1 out of 25 times. The failure always
> happen at first instance. Subsequent tries work correctly.
Indeed; on my tests I was running 100 times to validate.
Thanks for the review Sachin
>
> With this patch applied the test completes successfully 25 out of 25 times.
>
> # ./cycles_test
> test: cycles
> …..
> …..
>    [25]: register SPRN_MMCR0 = 0x0000000080000080
>    [26]: register SPRN_PMC1  = 0x0000000080000004
>    [27]: counter = 10
>    [28]: register SPRN_MMCR0 = 0x0000000080000080
>    [29]: register SPRN_PMC1  = 0x0000000080000004
>    [30]: register SPRN_PMC1  = 0x000000004000048f
> PMC1 count (0x2800004b7) above upper limit 0x2800003e8 (+0xcf)
> [FAIL] Test FAILED on line 52
> failure: cycles
>
> With the patch
>
> # ./cycles_test
> test: cycles
> …..
> …..
>    [25]: register SPRN_MMCR0 = 0x0000000080000080
>    [26]: register SPRN_PMC1  = 0x0000000080000004
>    [27]: counter = 10
>    [28]: register SPRN_MMCR0 = 0x0000000080000080
>    [29]: register SPRN_PMC1  = 0x0000000080000004
> PMC1 count (0x280000028) is between 0x27ffffc18 and 0x2800003e8 delta +0x410/-0x3c0
> success: cycles
> #
>
> FWIW   Tested-by : Sachin Sant <sachinp at linux.vnet.ibm.com>
>
> Thanks
> -Sachin

-- 
Desnes A. Nunes do Rosario
--------------------------------
Advisory Software Engineer - IBM
Virtual Onsite Engineer - Red Hat



More information about the Linuxppc-dev mailing list