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@xxxxxxxxx/ (trace-cmd library: Extend host-guest time sync with fraction bits) Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> --- 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