[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240703095712.64202-19-dapeng1.mi@linux.intel.com>
Date: Wed, 3 Jul 2024 09:57:12 +0000
From: Dapeng Mi <dapeng1.mi@...ux.intel.com>
To: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jim Mattson <jmattson@...gle.com>,
Mingwei Zhang <mizhang@...gle.com>,
Xiong Zhang <xiong.y.zhang@...el.com>,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
Like Xu <like.xu.linux@...il.com>,
Jinrong Liang <cloudliang@...cent.com>,
Dapeng Mi <dapeng1.mi@...el.com>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>
Subject: [Patch v5 18/18] x86: pmu: Print measured event count if test fails
Print the measured event count if the test case fails. This helps users
quickly know why the test case fails.
Signed-off-by: Dapeng Mi <dapeng1.mi@...ux.intel.com>
---
x86/pmu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/x86/pmu.c b/x86/pmu.c
index 332d274c..0658a1c1 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -398,8 +398,12 @@ static noinline void __measure(pmu_counter_t *evt, uint64_t count)
static bool verify_event(uint64_t count, struct pmu_event *e)
{
- // printf("%d <= %ld <= %d\n", e->min, count, e->max);
- return count >= e->min && count <= e->max;
+ bool pass = count >= e->min && count <= e->max;
+
+ if (!pass)
+ printf("FAIL: %d <= %"PRId64" <= %d\n", e->min, count, e->max);
+
+ return pass;
}
static bool verify_counter(pmu_counter_t *cnt)
--
2.40.1
Powered by blists - more mailing lists