This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] reading time value in dom0 and domU kernels

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] reading time value in dom0 and domU kernels
From: "sanjay kumar" <sanjay.kushwaha@xxxxxxxxx>
Date: Sat, 15 Apr 2006 00:21:21 -0400
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 14 Apr 2006 21:21:43 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=a3EZTcpz3IPb99mL/h1nUFuv4YzAhdlqgvYtM5ZiP2u3go/ZHJ70hGEyOy+H51jCCkOdvF1JISee90gbEgn2lHKW+Ft9yAL90leZLcyZ8eNyN7ggJ2sIxtrVrrcFIyJVovanCeYcnBPTHuSZNUkZOrGvqcAN0x3ndmteXYQBdD0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <a34c83cc311696e43fb8a5d15fd52ede@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <2717599f0604090819g5433b228p486ae4f8dbb343e9@xxxxxxxxxxxxxx> <a34c83cc311696e43fb8a5d15fd52ede@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Keir/All,
If I want to measure time at the application level, is there any API available? can gettimeofday in domU give me real time value?


On 4/9/06, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> wrote:

On 9 Apr 2006, at 16:19, sanjay kumar wrote:

> Hi Folks,
>  I want to calculate latency in transferring a buffer from domU kernel
> to dom0 kernel and vice versa. for that I need a time 'flavour' (cycle
> counter time?) which reads the same in dom0 and domU. Could someone
> please let me know if cycle counter time is the right time to use? if
> not then which one (system time or wall clock time)? Also could
> someone please tell me how to read to read this timer value.
>  if I use rdtsc() in both dom0 and domU, will it give me the same time
> value?

It should be close enough as Xen attempts to synchronise the TSCs of
all CPUs during boot and on most x86 platforms the TSCs will not

If you're measuring in the kernel then something like 'sched_clock()'
will get you system time in nanoseconds. That would be slightly
preferable as system time is actively synchronised across all domains.
With TSC you are winging it a tiny bit (although it's usually an okay
strategy on x86).

  -- Keir

PhD Student, Georgia Tech
Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>