[profile]: [17/23] x86-64 profiling cleanups

From: William Lee Irwin III
Date: Tue Jun 22 2004 - 11:39:37 EST


Convert x86-64 to use profiling_on() and profile_tick().

Index: prof-2.6.7/include/asm-x86_64/hw_irq.h
===================================================================
--- prof-2.6.7.orig/include/asm-x86_64/hw_irq.h 2004-06-15 22:20:04.000000000 -0700
+++ prof-2.6.7/include/asm-x86_64/hw_irq.h 2004-06-22 07:25:57.557413112 -0700
@@ -130,36 +130,15 @@

static inline void x86_do_profile (struct pt_regs *regs)
{
- unsigned long rip;
extern unsigned long prof_cpu_mask;
- extern char _stext[];

- profile_hook(regs);
-
- if (user_mode(regs))
- return;
- if (!prof_buffer)
- return;
-
- rip = regs->rip;
-
/*
* Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
* (default is all CPUs.)
*/
- if (!((1<<smp_processor_id()) & prof_cpu_mask))
- return;
-
- rip -= (unsigned long) &_stext;
- rip >>= prof_shift;
- /*
- * Don't ignore out-of-bounds EIP values silently,
- * put them into the last histogram slot, so if
- * present, they will show up as a sharp peak.
- */
- if (rip > prof_len-1)
- rip = prof_len-1;
- atomic_inc((atomic_t *)&prof_buffer[rip]);
+ profile_hook(regs);
+ if (!user_mode(regs) && ((1<<smp_processor_id()) & prof_cpu_mask))
+ profile_tick(regs->rip);
}

#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP)
-
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/