I assume you are trying to measure time elapsed from inside of a VM in a guest
OS kernel?
If you are running Xen 4.0 or later, you can use the hardware rdtsc instruction
to measure elapsed time as it is guaranteed by Xen to be synchronized across
cores. Note that unless you are certain that Xen cannot reschedule another VM
(including dom0) during your hypercall, you may sometimes see some weird very
large measurements which indicate that a scheduling event has occurred.
See docs/misc/tscmode.txt in the Xen source tree (especially the history
section) for more information about the TSC.
If you are trying to measure elapsed time IN Xen, see the various CYC_COUNTER
macros in xen/common/tmem.c as an example of how this can be done.
From: Srujan Kotikela [mailto:ksrujandas@gmail.com]
Sent: Friday, March 25, 2011 3:24 PM
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Xen System Time
Hi,
Is there any interface for Xen System Time? I am trying to find the average time
Xen takes for several operations. I am planning to add small code to hypercall
definitions in xen to clock the time to perform that particular functionality.
Are there any functions available in xen which gives time in the Xen kernel. The
interface manual talks about "System Time". But I didn''t find
any functions/hypercalls for that. The only one I found was guest_set_time().
--
Srujan D. Kotikela
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel