Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-05 Thread Paolo Bonzini
On 02/09/2016 19:31, Luiz Capitulino wrote: > On Fri, 2 Sep 2016 19:00:41 +0200 > Paolo Bonzini wrote: > >> On 31/08/2016 19:05, Luiz Capitulino wrote: >>> vcpu0: 18446742405270834952 >>> vcpu1: 18446742405270834952 >>> vcpu2: 18446742405270834952 >>> vcpu3:

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-05 Thread Paolo Bonzini
On 02/09/2016 19:31, Luiz Capitulino wrote: > On Fri, 2 Sep 2016 19:00:41 +0200 > Paolo Bonzini wrote: > >> On 31/08/2016 19:05, Luiz Capitulino wrote: >>> vcpu0: 18446742405270834952 >>> vcpu1: 18446742405270834952 >>> vcpu2: 18446742405270834952 >>> vcpu3: 18446742405270834952 >>>

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Masami Hiramatsu
On Fri, 2 Sep 2016 21:23:11 -0300 Marcelo Tosatti wrote: > On Fri, Sep 02, 2016 at 10:15:41AM -0400, Steven Rostedt wrote: > > On Fri, 2 Sep 2016 09:43:01 -0400 > > Stefan Hajnoczi wrote: > > > > > Can TSC offset changes occur at runtime? > > Yes, but

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Masami Hiramatsu
On Fri, 2 Sep 2016 21:23:11 -0300 Marcelo Tosatti wrote: > On Fri, Sep 02, 2016 at 10:15:41AM -0400, Steven Rostedt wrote: > > On Fri, 2 Sep 2016 09:43:01 -0400 > > Stefan Hajnoczi wrote: > > > > > Can TSC offset changes occur at runtime? > > Yes, but Linux guests don't write to the TSC

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 20:49:37 -0300 Marcelo Tosatti wrote: > On Fri, Sep 02, 2016 at 09:43:01AM -0400, Stefan Hajnoczi wrote: > > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > > We need to retrieve a VM's TSC offset in order to use > > > the host's TSC

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 20:49:37 -0300 Marcelo Tosatti wrote: > On Fri, Sep 02, 2016 at 09:43:01AM -0400, Stefan Hajnoczi wrote: > > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > > We need to retrieve a VM's TSC offset in order to use > > > the host's TSC to merge host and

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Marcelo Tosatti
On Fri, Sep 02, 2016 at 10:15:41AM -0400, Steven Rostedt wrote: > On Fri, 2 Sep 2016 09:43:01 -0400 > Stefan Hajnoczi wrote: > > > Can TSC offset changes occur at runtime? Yes, but Linux guests don't write to the TSC offset after booting and unless user does manual TSC

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Marcelo Tosatti
On Fri, Sep 02, 2016 at 10:15:41AM -0400, Steven Rostedt wrote: > On Fri, 2 Sep 2016 09:43:01 -0400 > Stefan Hajnoczi wrote: > > > Can TSC offset changes occur at runtime? Yes, but Linux guests don't write to the TSC offset after booting and unless user does manual TSC writes. > > One example

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Marcelo Tosatti
On Fri, Sep 02, 2016 at 09:43:01AM -0400, Stefan Hajnoczi wrote: > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > We need to retrieve a VM's TSC offset in order to use > > the host's TSC to merge host and guest traces. This is > > explained in detail in this thread: > > > >

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Marcelo Tosatti
On Fri, Sep 02, 2016 at 09:43:01AM -0400, Stefan Hajnoczi wrote: > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > We need to retrieve a VM's TSC offset in order to use > > the host's TSC to merge host and guest traces. This is > > explained in detail in this thread: > > > >

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 19:00:41 +0200 Paolo Bonzini wrote: > On 31/08/2016 19:05, Luiz Capitulino wrote: > > vcpu0: 18446742405270834952 > > vcpu1: 18446742405270834952 > > vcpu2: 18446742405270834952 > > vcpu3: 18446742405270834952 > > > > - We'll probably need to

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 19:00:41 +0200 Paolo Bonzini wrote: > On 31/08/2016 19:05, Luiz Capitulino wrote: > > vcpu0: 18446742405270834952 > > vcpu1: 18446742405270834952 > > vcpu2: 18446742405270834952 > > vcpu3: 18446742405270834952 > > > > - We'll probably need to export the TSC

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Paolo Bonzini
On 31/08/2016 19:05, Luiz Capitulino wrote: > vcpu0: 18446742405270834952 > vcpu1: 18446742405270834952 > vcpu2: 18446742405270834952 > vcpu3: 18446742405270834952 > > - We'll probably need to export the TSC multiplier too. >However, I've been using only the TSC offset for now. >

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Paolo Bonzini
On 31/08/2016 19:05, Luiz Capitulino wrote: > vcpu0: 18446742405270834952 > vcpu1: 18446742405270834952 > vcpu2: 18446742405270834952 > vcpu3: 18446742405270834952 > > - We'll probably need to export the TSC multiplier too. >However, I've been using only the TSC offset for now. >

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 12:26:55 -0400 Luiz Capitulino wrote: > I guess that what tools like trace-cmd want to do in those cases > is to warn the user and discard the trace. A simple way of doing > this would be to re-check that the TSC offset are the same after > tracing is

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 12:26:55 -0400 Luiz Capitulino wrote: > I guess that what tools like trace-cmd want to do in those cases > is to warn the user and discard the trace. A simple way of doing > this would be to re-check that the TSC offset are the same after > tracing is done. It could also use

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 09:43:01 -0400 Stefan Hajnoczi wrote: > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > We need to retrieve a VM's TSC offset in order to use > > the host's TSC to merge host and guest traces. This is > > explained in detail in this

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Luiz Capitulino
On Fri, 2 Sep 2016 09:43:01 -0400 Stefan Hajnoczi wrote: > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > We need to retrieve a VM's TSC offset in order to use > > the host's TSC to merge host and guest traces. This is > > explained in detail in this thread: > > > >

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Steven Rostedt
On Fri, 2 Sep 2016 09:43:01 -0400 Stefan Hajnoczi wrote: > Can TSC offset changes occur at runtime? > > One example is vcpu hotplug where the tracing tool would need to fetch > the new vcpu's TSC offset after tracing has already started. > > Another example is if QEMU or

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Steven Rostedt
On Fri, 2 Sep 2016 09:43:01 -0400 Stefan Hajnoczi wrote: > Can TSC offset changes occur at runtime? > > One example is vcpu hotplug where the tracing tool would need to fetch > the new vcpu's TSC offset after tracing has already started. > > Another example is if QEMU or the guest change the

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Stefan Hajnoczi
On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > We need to retrieve a VM's TSC offset in order to use > the host's TSC to merge host and guest traces. This is > explained in detail in this thread: > > [Qemu-devel] [RFC] host and guest kernel trace merging >

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Stefan Hajnoczi
On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > We need to retrieve a VM's TSC offset in order to use > the host's TSC to merge host and guest traces. This is > explained in detail in this thread: > > [Qemu-devel] [RFC] host and guest kernel trace merging >

[PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-08-31 Thread Luiz Capitulino
We need to retrieve a VM's TSC offset in order to use the host's TSC to merge host and guest traces. This is explained in detail in this thread: [Qemu-devel] [RFC] host and guest kernel trace merging https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg00887.html Today, the only way

[PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-08-31 Thread Luiz Capitulino
We need to retrieve a VM's TSC offset in order to use the host's TSC to merge host and guest traces. This is explained in detail in this thread: [Qemu-devel] [RFC] host and guest kernel trace merging https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg00887.html Today, the only way