[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: |
Peter Maydell |
Subject: |
Re: [kvm-unit-tests PATCH v2 5/9] arm: pmu: Basic event counter Tests |
Date: |
Tue, 11 Feb 2020 16:27:16 +0000 |
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.
thanks
-- PMM
- Re: [kvm-unit-tests PATCH v2 5/9] arm: pmu: Basic event counter Tests,
Peter Maydell <=