All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default
Date: Fri, 10 Dec 2021 13:55:08 +0200	[thread overview]
Message-ID: <20211210115508.103569-1-tz.stoyanov@gmail.com> (raw)

Guest's TSC fraction bits have sens only if there is TSC scaling. In
case of default value for TSC scaling, fraction bits should not be used
in TSC guest clock calculation.

Fixes: https://lore.kernel.org/linux-trace-devel/20211014150204.2485499-3-tz.stoyanov@gmail.com/
	(trace-cmd library: Extend host-guest time sync with fraction bits)

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/trace-timesync-kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/trace-cmd/trace-timesync-kvm.c b/lib/trace-cmd/trace-timesync-kvm.c
index 8d531922..12a22d4c 100644
--- a/lib/trace-cmd/trace-timesync-kvm.c
+++ b/lib/trace-cmd/trace-timesync-kvm.c
@@ -415,7 +415,7 @@ static int kvm_clock_host(struct tracecmd_time_sync *tsync,
 			kvm_scaling = 1;
 	}
 
-	if (kvm->vcpu_frac && kvm->vcpu_frac[cpu])
+	if (kvm->vcpu_frac && kvm->vcpu_frac[cpu] && kvm_scaling != 1)
 		ret = read_ll_from_file(kvm->vcpu_frac[cpu], &kvm_frac);
 	msg = (char *)&packet;
 	size = sizeof(packet);
-- 
2.33.1


             reply	other threads:[~2021-12-10 11:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 11:55 Tzvetomir Stoyanov (VMware) [this message]
2022-02-16 15:43 ` [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default Tzvetomir Stoyanov
2022-02-16 16:47   ` Steven Rostedt

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=20211210115508.103569-1-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.