diff -urN 2.3.99pre1/include/asm-i386/hw_irq.h p/include/asm-i386/hw_irq.h --- 2.3.99pre1/include/asm-i386/hw_irq.h Tue Mar 14 18:48:45 2000 +++ p/include/asm-i386/hw_irq.h Wed Mar 15 16:49:14 2000 @@ -189,6 +189,9 @@ */ static inline void x86_do_profile (unsigned long eip) { + if (!prof_buffer) + return; + /* * Only measure the CPUs specified by /proc/irq/prof_cpu_mask. * (default is all CPUs.) @@ -196,18 +199,16 @@ if (!((1<>= 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 (eip > prof_len-1) - eip = prof_len-1; - atomic_inc((atomic_t *)&prof_buffer[eip]); - } + eip -= (unsigned long) &_stext; + eip >>= 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 (eip > prof_len-1) + eip = prof_len-1; + atomic_inc((atomic_t *)&prof_buffer[eip]); } #ifdef __SMP__ /*more of this file should probably be ifdefed SMP */