Skip to contentSkip to conversation

Remove X86_TSC dependency in net profile code

PATCH In review Andi Kleen 2 participants 3 messages Sep 2, 2003 – Sep 4, 2003

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to Andi Kleen
Quoted 3 lines · On Wed, 3 Sep 2003 01:00:57 +0200 Andi Kleen <[email protected]> wrote:

I did not actually compile test this because net profile is commented out since a long time and doesn't compile. An alternative if noone comes up to fix it would be just to remove it completely.

Alexey, time to remove the net profile stuff?

Andi Kleen

author
#0 lore raw

PATCH 1/1 Remove X86_TSC dependency in net profile code

This removes one of the remaining users of CONFIG_X86_TSC

Replace it with a runtime test instead. In some configurations it will be still properly optimized because cpu_has_tsc will expand to a constant then.

This also makes it handle x86-64.

I did not actually compile test this because net profile is commented out since a long time and doesn't compile. An alternative if noone comes up to fix it would be just to remove it completely.

-Andi

include/net/profile.h renamed from include/net/profile.h-o +5 -2
@@ -29,11 +29,14 @@
 extern struct timeval net_profile_adjust;
 extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved);
 
-#ifdef CONFIG_X86_TSC
+#ifdef CONFIG_X86
 
 static inline void  net_profile_stamp(struct timeval *pstamp)
 {
-	rdtsc(pstamp->tv_usec, pstamp->tv_sec);
+	if (cpu_has_tsc)
+		rdtsc(pstamp->tv_usec, pstamp->tv_sec);
+	else
+		do_gettimeofday(pstamp);
 }
 
 static inline void  net_profile_accumulate(struct timeval *entered,
#2 lore raw
Quoted 3 lines · On Wed, 3 Sep 2003 01:00:57 +0200 Andi Kleen <[email protected]> wrote:

I did not actually compile test this because net profile is commented out since a long time and doesn't compile. An alternative if noone comes up to fix it would be just to remove it completely.

I decided to just kill net profile for now.

Thanks for bringing this to my attention Andi.