From: Stefano De Venuto <stefano.devenuto99@gmail.com>
To: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Linux Trace Devel <linux-trace-devel@vger.kernel.org>,
Dario Faggioli <dfaggioli@suse.com>
Subject: Re: [PATCH v32 0/5]Timestamp synchronization of host - guest tracing session
Date: Thu, 25 Mar 2021 19:01:12 +0100 [thread overview]
Message-ID: <f40089f0-a45d-5e8d-e0e6-5f7ab59c9992@gmail.com> (raw)
In-Reply-To: <CAPpZLN5HcuFnN9_gMnS=JKeu3p9dEUWHmF6iwoh-mLPz=6WaiQ@mail.gmail.com>
On 3/25/21 8:20 AM, Tzvetomir Stoyanov wrote:
> Hi Stefano,
>
> On Sat, Mar 20, 2021 at 6:17 PM Stefano De Venuto
> <stefano.devenuto99@gmail.com> wrote:
>>
>>
>> On 3/20/21 7:25 AM, Tzvetomir Stoyanov wrote:
>>> Hi Stefano,
>>>
>>> On Fri, Mar 19, 2021 at 7:44 PM Stefano De Venuto
>>> <stefano.devenuto99@gmail.com> wrote:
>>>>
>>>> On 3/19/21 12:55 PM, Tzvetomir Stoyanov wrote:
>>>>> Hi Stefano,
>>>>>
>>>>> On Fri, Mar 19, 2021 at 12:08 PM Stefano De Venuto
>>>>> <stefano.devenuto99@gmail.com> wrote:
>>>> Hi!
>>>>>> The commands used to record are:
>>>>>>
>>>>>> Host:
>>>>>> # trace-cmd record -C x86-tsc -e kvm:* -e msr:* -A tumbleweed:823 -e
>>>>>> msr:* -C x86-tsc sleep 1
>>>>> The guest trace clock is set automatically as the host, so this
>>>>> command should be enough:
>>>>> # trace-cmd record -C x86-tsc -e kvm:* -e msr:* -A tumbleweed:823 -e
>>>>> msr:* sleep 1
>>>>>
>>>>>> Guest:
>>>>>> # echo x86-tsc > /sys/kernel/tracing/trace_clock
>>>>> There is no need to set manually the guest clock, it will be
>>>>> overwritten by trace-cmd agent.
>>>>>
>>>> Thanks so much for the proper way to do it, really appreciated.
>>>>>> If necessary, I can provide more info about my setup, or do more tests.
>>>>> Yes, please can you send me both host and guest trace files ?
>>>> Here are the trace files, host and guest respectively:
>>>>
>>>> - http://xenbits.xen.org/people/dariof/tracing-examples/kvm/sync-kvmclock/trace.dat
>>>> - http://xenbits.xen.org/people/dariof/tracing-examples/kvm/sync-kvmclock/trace-tumbleweed.dat
>>>>
>>>>> Also, it will be useful to send me the content of the KVM debug files:
>>>>> /sys/kernel/debug/kvm/<guest ID>/vcpu<*>/tsc-offset
>>>> The guest has one vcpu (vcpu0) and the content of the file is:
>>>>
>>>> 255647917761327
>>> Looks like there is a scaling between host and guest clocks in your
>>> setup, not just a simple offset. We did not test yet our
>>> implementation with scaling, although both offset and scaling are part
>>> of the calculations. That makes your use case very valuable for us, as
>>> we have an opportunity to test it now. And yes, looks like we have a
>>> bug here.
>>> Please, when you have time, can you repeat again the tracing session
>>> and send again both trace files + the content of the KVM debug files:
>>> /sys/kernel/debug/kvm/<guest ID>/vcpu0/tsc-offset
>>> /sys/kernel/debug/kvm/<guest ID>/vcpu0/tsc-scaling-ratio
>>> I'm asking to do a new trace, as most probably these offset and
>>> scaling could be different now.
>> Yes, the trace files are attached to this mail.
>>
>> The content of tsc-offset is:
>> 453568564244284
>>
>> The content of tsc-scaling-ratio is:
>> 4294967296
>>
> Just submitted the v33 of the patch set, added a check for a
> non-default KVM scaling. Now it should work on your setup, as the KVM
> scaling there looks to be the default. I didn't test it, as we have no
> machine which supports KVM scaling. This is just a workaround, we have
> to implement support to KVM scaling in our algorithm.
> Please, can you test if it is OK ? Note, you have to apply these
> patch sets also, as there are dependencies:
> v2 Refactoring and improvements of time sync logic
> v4 TSC trace clock to nanosecond conversion
>
> Thanks for testing this code!
I tested the patch series and now works properly on my setup!
Thanks,
Stefano
>
>> Thanks and Regards,
>>
>> Stefano
>>
>>> Thanks!
>>>
>>>>>> Thanks and Regards,
>>>>>>
>>>>>> Stefano
>>>>> Thanks for testing this code!
>>>>>
>>>> Thanks for your time,
>>>>
>>>> Stefano
>>>
>
prev parent reply other threads:[~2021-03-25 18:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 6:18 [PATCH v32 0/5]Timestamp synchronization of host - guest tracing session Tzvetomir Stoyanov (VMware)
2021-03-15 6:18 ` [PATCH v32 1/5] trace-cmd: Add dummy function to initialize timestamp sync logic Tzvetomir Stoyanov (VMware)
2021-03-15 6:18 ` [PATCH v32 2/5] trace-cmd: Add timestamp synchronization per vCPU Tzvetomir Stoyanov (VMware)
2021-03-15 6:18 ` [PATCH v32 3/5] trace-cmd: PTP-like algorithm for host - guest timestamp synchronization Tzvetomir Stoyanov (VMware)
2021-03-15 6:18 ` [PATCH v32 4/5] trace-cmd: Debug scripts for " Tzvetomir Stoyanov (VMware)
2021-03-15 6:18 ` [PATCH v32 5/5] trace-cmd [POC]: Add KVM timestamp synchronization plugin Tzvetomir Stoyanov (VMware)
2021-03-19 10:08 ` [PATCH v32 0/5]Timestamp synchronization of host - guest tracing session Stefano De Venuto
2021-03-19 11:55 ` Tzvetomir Stoyanov
2021-03-19 17:44 ` Stefano De Venuto
2021-03-20 6:25 ` Tzvetomir Stoyanov
[not found] ` <0f6e158c-43a3-4117-2a17-5a13cd6a7970@gmail.com>
2021-03-22 10:13 ` Tzvetomir Stoyanov
2021-03-22 14:56 ` Steven Rostedt
2021-03-25 20:55 ` Dario Faggioli
2021-03-25 7:20 ` Tzvetomir Stoyanov
2021-03-25 18:01 ` Stefano De Venuto [this message]
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=f40089f0-a45d-5e8d-e0e6-5f7ab59c9992@gmail.com \
--to=stefano.devenuto99@gmail.com \
--cc=dfaggioli@suse.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tz.stoyanov@gmail.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).