kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Like Xu <like.xu.linux@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH kvm-unit-tests] x86/pmu: Make "ref cycles" test to pass on the latest cpu
Date: Mon, 22 Nov 2021 19:57:58 +0800	[thread overview]
Message-ID: <20211122115758.46504-1-likexu@tencent.com> (raw)

From: Like Xu <likexu@tencent.com>

Expand the boundary for "ref cycles" event test as it has
been observed that the results do not fit on some CPUs [1]:

FAIL: full-width writes: ref cycles-N
  100000 >= 87765 <= 30000000
  100000 >= 87926 <= 30000000
  100000 >= 87790 <= 30000000
  100000 >= 87687 <= 30000000
  100000 >= 87875 <= 30000000
  100000 >= 88043 <= 30000000
  100000 >= 88161 <= 30000000
  100000 >= 88052 <= 30000000

[1] Intel(R) Xeon(R) Platinum 8374C CPU @ 2.70GHz

Opportunistically fix cc1 warnings for commented print statement.

Signed-off-by: Like Xu <likexu@tencent.com>
---
 x86/pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/pmu.c b/x86/pmu.c
index 92206ad..3d05384 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -86,7 +86,7 @@ struct pmu_event {
 } gp_events[] = {
 	{"core cycles", 0x003c, 1*N, 50*N},
 	{"instructions", 0x00c0, 10*N, 10.2*N},
-	{"ref cycles", 0x013c, 0.1*N, 30*N},
+       {"ref cycles", 0x013c, 0.08*N, 30*N},
 	{"llc refference", 0x4f2e, 1, 2*N},
 	{"llc misses", 0x412e, 1, 1*N},
 	{"branches", 0x00c4, 1*N, 1.1*N},
@@ -223,7 +223,7 @@ static void measure(pmu_counter_t *evt, int count)
 
 static bool verify_event(uint64_t count, struct pmu_event *e)
 {
-	// printf("%lld >= %lld <= %lld\n", e->min, count, e->max);
+	// printf("%d >= %ld <= %d\n", e->min, count, e->max);
 	return count >= e->min  && count <= e->max;
 
 }
-- 
2.33.1


                 reply	other threads:[~2021-11-22 11:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211122115758.46504-1-likexu@tencent.com \
    --to=like.xu.linux@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).