On Wed, Apr 29, 2015 at 2:43 PM, Meng Xu <xumengpa...@gmail.com> wrote:
>
>
> 2015-04-28 22:46 GMT-04:00 Xuehan Xu <xxhdx1985...@gmail.com>:
>
>> ---------- Forwarded message ----------
>> From: "Xuehan Xu" <xxhdx1985...@gmail.com>
>> Date: Apr 29, 2015 10:11 AM
>> Subject: How to get real time in a xen vm?
>> To: <xs-de...@lists.xenserver.org>
>> 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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to