Index: linux-2.6.9-rc3-mm3/kernel/profile.c
===================================================================
--- linux-2.6.9-rc3-mm3.orig/kernel/profile.c	2004-10-07 17:07:07.000000000 +1000
+++ linux-2.6.9-rc3-mm3/kernel/profile.c	2004-10-07 17:43:19.561391376 +1000
@@ -381,10 +381,12 @@ static int __devinit profile_cpu_callbac
 #define profile_flip_buffers()		do { } while (0)
 #define profile_discard_flip_buffers()	do { } while (0)
 
-inline void profile_hit(int type, void *__pc)
+void profile_hit(int type, void *__pc)
 {
 	unsigned long pc;
 
+	if (prof_on != type || !prof_buffer)
+		return;
 	pc = ((unsigned long)__pc - (unsigned long)_stext) >> prof_shift;
 	atomic_inc(&prof_buffer[min(pc, prof_len - 1)]);
 }
@@ -394,8 +396,6 @@ void profile_tick(int type, struct pt_re
 {
 	if (type == CPU_PROFILING)
 		profile_hook(regs);
-	if (prof_on != type || !prof_buffer)
-		return;
 	if (!user_mode(regs) && cpu_isset(smp_processor_id(), prof_cpu_mask))
 		profile_hit(type, (void *)profile_pc(regs));
 }

