[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Fwd: How to get real time in a xen vm?



On Wed, Apr 29, 2015 at 2:43 PM, Meng Xu <xumengpanda@xxxxxxxxx> wrote:
>
>
> 2015-04-28 22:46 GMT-04:00 Xuehan Xu <xxhdx1985126@xxxxxxxxx>:
>
>> ---------- Forwarded message ----------
>> From: "Xuehan Xu" <xxhdx1985126@xxxxxxxxx>
>> Date: Apr 29, 2015 10:11 AM
>> Subject: How to get real time in a xen vm?
>> To: <xs-devel@xxxxxxxxxxxxxxxxxxx>
>> Cc:
>>
>> Hi, everyone
>>
>> Recently, I got a need to measure the latency of the I/O operation of
>> TAPDISK on dom0, in comparison with that latency on a phyisical machine.
>>
>> I tried to measure the latency by calling "gettimeofday" right before and
>> after the io operation and compute the difference. But the time acquired by
>> gettimeofday is a virtual time of the dom0, which makes it meaningless to
>> compare to the latency on a physical machine.
>>
>> How can I get the real and highly accurate time in dom0? Thanks:)
>
>
> You may want to try the instruction 'rdtsc' to read the timestamp counter
> register to get the latency.

Also, you probably want to set the TSC mode to "never emulate".  See

http://xenbits.xen.org/docs/4.5-testing/misc/tscmode.txt

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.