lkml.org 
[lkml]   [2023]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 4/9] KVM: selftests: Test Intel PMU architectural events on gp counters
From
On Mon, Sep 11, 2023, Jinrong Liang wrote:
> +static void test_intel_arch_events(void)
> +{
> + uint8_t idx;
> +
> + for (idx = 0; idx < NR_INTEL_ARCH_EVENTS; idx++) {
> + /*
> + * Given the stability of performance event recurrence, only
> + * these arch events are currently being tested:
> + *
> + * - Core cycle event (idx = 0)
> + * - Instruction retired event (idx = 1)
> + * - Reference cycles event (idx = 2)
> + * - Branch instruction retired event (idx = 5)
> + */
> + if (idx > INTEL_ARCH_INSTRUCTIONS_RETIRED &&
> + idx != INTEL_ARCH_BRANCHES_RETIRED)
> + continue;
> +
> + check_arch_event_is_unavl(idx);

Rather than completely skip the event, just don't check the counter. That way
the test still verifies that it can program the event, it's only the result that
isn't stable enough to assert on.

\
 
 \ /
  Last update: 2023-10-20 01:40    [W:0.163 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site