[profile]: [3/23] mips profiling cleanups

From: William Lee Irwin III
Date: Tue Jun 22 2004 - 10:43:15 EST


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

Index: prof-2.6.7/arch/mips/kernel/time.c
===================================================================
--- prof-2.6.7.orig/arch/mips/kernel/time.c 2004-06-15 22:19:22.000000000 -0700
+++ prof-2.6.7/arch/mips/kernel/time.c 2004-06-22 07:25:45.377264776 -0700
@@ -24,6 +24,7 @@
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/profile.h>

#include <asm/bootinfo.h>
#include <asm/cpu.h>
@@ -417,22 +418,8 @@
*/
void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
- if (!user_mode(regs)) {
- if (prof_buffer && current->pid) {
- unsigned long pc = regs->cp0_epc;
-
- pc -= (unsigned long) _stext;
- pc >>= prof_shift;
- /*
- * Dont 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]);
- }
- }
+ if (!user_mode(regs) && profiling_on() && current->pid)
+ profile_tick(regs->cp0_epc);

#ifdef CONFIG_SMP
/* in UP mode, update_process_times() is invoked by do_timer() */
-
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/