linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default
@ 2021-12-10 11:55 Tzvetomir Stoyanov (VMware)
  2022-02-16 15:43 ` Tzvetomir Stoyanov
  0 siblings, 1 reply; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2021-12-10 11:55 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default
  2021-12-10 11:55 [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default Tzvetomir Stoyanov (VMware)
@ 2022-02-16 15:43 ` Tzvetomir Stoyanov
  2022-02-16 16:47   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Tzvetomir Stoyanov @ 2022-02-16 15:43 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel

ping
Just to remind, this one is an important bugfix. It fixes host-guest
tracing with the latest kernels, where new KVM debug info is exposed
through the debugfs.

On Fri, Dec 10, 2021 at 1:55 PM Tzvetomir Stoyanov (VMware)
<tz.stoyanov@gmail.com> wrote:
>
> 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
>


-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default
  2022-02-16 15:43 ` Tzvetomir Stoyanov
@ 2022-02-16 16:47   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2022-02-16 16:47 UTC (permalink / raw)
  To: Tzvetomir Stoyanov; +Cc: Linux Trace Devel

On Wed, 16 Feb 2022 17:43:46 +0200
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:

> ping
> Just to remind, this one is an important bugfix. It fixes host-guest
> tracing with the latest kernels, where new KVM debug info is exposed
> through the debugfs.

Hi Tzvetomir,

It's actually already in my local queue. I just haven't had a chance to
push it up yet.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-16 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-10 11:55 [PATCH] trace-cmd library: Do not record TSC frac bits if scaling is default Tzvetomir Stoyanov (VMware)
2022-02-16 15:43 ` Tzvetomir Stoyanov
2022-02-16 16:47   ` Steven Rostedt

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).