[SPARC64]: Rate limited kernel unaligned trap logging, ala IA64.
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 22 Jun 2006 05:31:08 +0000 (22:31 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 24 Jun 2006 06:15:11 +0000 (23:15 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/unaligned.c

index 001e8518331fb91bf56a28d2770e9cfef68769f0..bb2d685778555e9fb9f65a0fcbd69d23b9d18112 100644 (file)
@@ -279,12 +279,21 @@ static void kernel_mna_trap_fault(void)
 
 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
 {
+       static unsigned long count, last_time;
        enum direction dir = decode_direction(insn);
        int size = decode_access_size(insn);
 
        current_thread_info()->kern_una_regs = regs;
        current_thread_info()->kern_una_insn = insn;
 
+       if (jiffies - last_time > 5 * HZ)
+               count = 0;
+       if (count < 5) {
+               last_time = jiffies;
+               count++;
+               printk("Kernel unaligned access at TPC[%lx]\n", regs->tpc);
+       }
+
        if (!ok_for_kernel(insn) || dir == both) {
                printk("Unsupported unaligned load/store trap for kernel "
                       "at <%016lx>.\n", regs->tpc);