Messages in this thread | | | Date | Tue, 24 May 2011 12:34:33 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH 5/7] um: print info about fatal segfaults |
| |
On Sun, 22 May 2011 16:48:34 +0200 Richard Weinberger <richard@nod.at> wrote:
> +static void show_segv_info(struct uml_pt_regs *regs) > +{ > + struct task_struct *tsk = current; > + struct faultinfo *fi = UPT_FAULTINFO(regs); > + > + if (!unhandled_signal(tsk, SIGSEGV)) > + return; > + > + if (!printk_ratelimit()) > + return; > + > + printk("%s%s[%d]: segfault at %lx ip %p sp %p error %x", > + task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, > + tsk->comm, task_pid_nr(tsk), FAULT_ADDRESS(*fi), > + (void *)UPT_IP(regs), (void *)UPT_SP(regs), > + fi->error_code); > + > + print_vma_addr(KERN_CONT " in ", UPT_IP(regs)); > + printk(KERN_CONT "\n"); > +}
Please see the nice comment in printk.h
/* * Please don't use printk_ratelimit(), because it shares ratelimiting state * with all other unrelated printk_ratelimit() callsites. Instead use * printk_ratelimited() or plain old __ratelimit(). */
I thought we had a checkpatch rule for this but apparently I dreamed it.
| |