WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Add get_cycles(), to be defined in asm/time.h, as a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Add get_cycles(), to be defined in asm/time.h, as a
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 01 Nov 2005 17:36:11 +0000
Delivery-date: Tue, 01 Nov 2005 17:34:30 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f1b6dd997716d28ea40d201450c1d29c80eb58fc
# Parent  6be0d21bb8638e63db97588324ffe4f3d3a24e8c
Add get_cycles(), to be defined in asm/time.h, as a
generic method to access cpu-specific local cycle counter.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 6be0d21bb863 -r f1b6dd997716 xen/common/trace.c
--- a/xen/common/trace.c        Mon Oct 31 16:14:59 2005
+++ b/xen/common/trace.c        Tue Nov  1 09:28:41 2005
@@ -260,7 +260,7 @@
     }
 
     rec = &t_recs[smp_processor_id()][buf->prod % nr_recs];
-    rdtscll(rec->cycles);
+    rec->cycles  = (u64)get_cycles();
     rec->event   = event;
     rec->data[0] = d1;
     rec->data[1] = d2;
diff -r 6be0d21bb863 -r f1b6dd997716 xen/include/asm-x86/time.h
--- a/xen/include/asm-x86/time.h        Mon Oct 31 16:14:59 2005
+++ b/xen/include/asm-x86/time.h        Tue Nov  1 09:28:41 2005
@@ -1,6 +1,8 @@
 
 #ifndef __X86_TIME_H__
 #define __X86_TIME_H__
+
+#include <asm/msr.h>
 
 extern int timer_ack;
 
@@ -10,4 +12,13 @@
 struct domain;
 extern void init_domain_time(struct domain *d);
 
+typedef u64 cycles_t;
+
+static inline cycles_t get_cycles(void)
+{
+    cycles_t c;
+    rdtscll(c);
+    return c;
+}
+
 #endif /* __X86_TIME_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Add get_cycles(), to be defined in asm/time.h, as a, Xen patchbot -unstable <=