patch-2.3.47 linux/include/net/profile.h

Next file: linux/kernel/ksyms.c
Previous file: linux/include/net/pkt_sched.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/include/net/profile.h linux/include/net/profile.h
@@ -9,6 +9,10 @@
 #include <linux/kernel.h>
 #include <asm/system.h>
 
+#ifdef CONFIG_X86_TSC
+#include <asm/msr.h>
+#endif
+
 struct net_profile_slot
 {
 	char   id[16];
@@ -25,14 +29,11 @@
 extern struct timeval net_profile_adjust;
 extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved);
 
-#if CPU == 586 || CPU == 686
-
+#ifdef CONFIG_X86_TSC
 
 extern __inline__ void  net_profile_stamp(struct timeval *pstamp)
 {
-	__asm__ __volatile__ (".byte 0x0f,0x31"
-		:"=a" (pstamp->tv_usec),
-		"=d" (pstamp->tv_sec));
+	rdtsc(pstamp->tv_usec, pstamp->tv_sec);
 }
 
 extern __inline__ void  net_profile_accumulate(struct timeval *entered,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)