[profile]: [7/23] superh profiling cleanups

From: William Lee Irwin III
Date: Tue Jun 22 2004 - 11:08:05 EST


Convert SuperH to use profiling_on() and profile_tick().

Index: prof-2.6.7/arch/sh/kernel/time.c
===================================================================
--- prof-2.6.7.orig/arch/sh/kernel/time.c 2004-06-15 22:18:37.000000000 -0700
+++ prof-2.6.7/arch/sh/kernel/time.c 2004-06-22 07:25:48.921725936 -0700
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/smp.h>
+#include <linux/profile.h>

#include <asm/processor.h>
#include <asm/uaccess.h>
@@ -235,32 +236,16 @@

/* Profiling definitions */
extern unsigned long prof_cpu_mask;
-extern unsigned int * prof_buffer;
-extern unsigned long prof_len;
-extern unsigned long prof_shift;
-extern char _stext;

static inline void sh_do_profile(unsigned long pc)
{
/* Don't profile cpu_idle.. */
- if (!prof_buffer || !current->pid)
+ if (!profiling_on() || !current->pid)
return;

if (pc >= 0xa0000000UL && pc < 0xc0000000UL)
pc -= 0x20000000;
-
- pc -= (unsigned long)&_stext;
- pc >>= prof_shift;
-
- /*
- * Don't ignore out-of-bounds PC values silently,
- * put them into the last histogram slot, so if
- * present, they will show up as a sharp peak.
- */
- if (pc > prof_len - 1)
- pc = prof_len - 1;
-
- atomic_inc((atomic_t *)&prof_buffer[pc]);
+ profile_tick(pc);
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/