LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] procfs: use WARN() rather than printk+backtrace
@ 2008-10-21 13:46 Arjan van de Ven
2008-10-23 8:35 ` Alexey Dobriyan
0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2008-10-21 13:46 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: linux-kernel
>From 20cba7e9bd227f3fb2e8042403af33be03dc31cf Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sat, 13 Sep 2008 19:51:30 -0700
Subject: [PATCH] procfs: use WARN() rather than printk+backtrace
Use WARN() rather than a printk() + backtrace();
this gives a more standard format message as well as complete
information (including line numbers etc) that will be collected
by kerneloops.org
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
fs/proc/generic.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 7821589..60a359b 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -547,9 +547,8 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp
for (tmp = dir->subdir; tmp; tmp = tmp->next)
if (strcmp(tmp->name, dp->name) == 0) {
- printk(KERN_WARNING "proc_dir_entry '%s/%s' already registered\n",
+ WARN(1, KERN_WARNING "proc_dir_entry '%s/%s' already registered\n",
dir->name, dp->name);
- dump_stack();
break;
}
--
1.5.5.1
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] procfs: use WARN() rather than printk+backtrace
2008-10-21 13:46 [PATCH] procfs: use WARN() rather than printk+backtrace Arjan van de Ven
@ 2008-10-23 8:35 ` Alexey Dobriyan
2008-10-23 13:30 ` Arjan van de Ven
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2008-10-23 8:35 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: linux-kernel
On Tue, Oct 21, 2008 at 06:46:12AM -0700, Arjan van de Ven wrote:
> - printk(KERN_WARNING "proc_dir_entry '%s/%s' already registered\n",
> + WARN(1, KERN_WARNING "proc_dir_entry '%s/%s' already registered\n",
Applied to proc.git
As a side note, seeing WARN twice on this line is depressing, and people
use WARN(, KERN_ERR);
I mean, how hard is to get something conceptually simple as warning right?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] procfs: use WARN() rather than printk+backtrace
2008-10-23 8:35 ` Alexey Dobriyan
@ 2008-10-23 13:30 ` Arjan van de Ven
0 siblings, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2008-10-23 13:30 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: linux-kernel
On Thu, 23 Oct 2008 12:35:47 +0400
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> On Tue, Oct 21, 2008 at 06:46:12AM -0700, Arjan van de Ven wrote:
> > - printk(KERN_WARNING "proc_dir_entry
> > '%s/%s' already registered\n",
> > + WARN(1, KERN_WARNING "proc_dir_entry
> > '%s/%s' already registered\n",
>
> Applied to proc.git
>
> As a side note, seeing WARN twice on this line is depressing, and
> people use WARN(, KERN_ERR);
>
> I mean, how hard is to get something conceptually simple as warning
> right?
if we were consistent about which level we wanted these things at we
could fold that into the macro. Sadly that's not the case ;(
(and then there's the issue with multilines etc)
Also, WARN() tries to be as printk() compatible as possible, and that
includes the log level....
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-23 13:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-21 13:46 [PATCH] procfs: use WARN() rather than printk+backtrace Arjan van de Ven
2008-10-23 8:35 ` Alexey Dobriyan
2008-10-23 13:30 ` Arjan van de Ven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).