lkml.org 
[lkml]   [2011]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2011-05-24 21:37    [W:0.056 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site