[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110524123433.0b74f33e.akpm@linux-foundation.org>
Date: Tue, 24 May 2011 12:34:33 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Richard Weinberger <richard@....at>
Cc: user-mode-linux-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, Joe Perches <joe@...ches.com>
Subject: Re: [PATCH 5/7] um: print info about fatal segfaults
On Sun, 22 May 2011 16:48:34 +0200
Richard Weinberger <richard@....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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists