[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kvm-unit-tests PATCH v2 5/9] arm: pmu: Basic event counter Tests
From: |
Auger Eric |
Subject: |
Re: [kvm-unit-tests PATCH v2 5/9] arm: pmu: Basic event counter Tests |
Date: |
Tue, 11 Feb 2020 19:31:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hi Peter,
On 2/11/20 5:27 PM, Peter Maydell wrote:
> On Thu, 30 Jan 2020 at 11:26, Eric Auger <address@hidden> wrote:
>>
>> Adds the following tests:
>> - event-counter-config: test event counter configuration
>> - basic-event-count:
>> - programs counters #0 and #1 to count 2 required events
>> (resp. CPU_CYCLES and INST_RETIRED). Counter #0 is preset
>> to a value close enough to the 32b
>> overflow limit so that we check the overflow bit is set
>> after the execution of the asm loop.
>> - mem-access: counts MEM_ACCESS event on counters #0 and #1
>> with and without 32-bit overflow.
>>
>> Signed-off-by: Eric Auger <address@hidden>
>
>> +static bool satisfy_prerequisites(uint32_t *events, unsigned int nb_events)
>> +{
>> + int i;
>> +
>> + if (pmu.nb_implemented_counters < nb_events) {
>> + report_skip("Skip test as number of counters is too small
>> (%d)",
>> + pmu.nb_implemented_counters);
>> + return false;
>> + }
>> +
>> + for (i = 0; i < nb_events; i++) {
>> + if (!is_event_supported(events[i], false)) {
>> + report_skip("Skip test as event %d is not supported",
>> + events[i]);
>
> Event numbers are given in hex in the Arm ARM and also
> specified in hex in your test source code. I think it
> would be more helpful if the message here used "0x%x", to
> save the reader having to do the decimal-to-hex conversion
> to find the event in the spec or the test case.
Sure I will fix that
Thanks
Eric
>
> thanks
> -- PMM
>