proc: more debugging for "already registered" case
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines · On Sat, 13 Sep 2008 21:59:02 GMT Linux Kernel Mailing List…
Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=665020c35e89a9e0643e21561e4f8f967f4f2c4b
Commit:665020c35e89a9e0643e21561e4f8f967f4f2c4bParent:a551b98d5f6fce5897d497abd8bfb262efb33d2aAuthor: Alexey Dobriyan
<[email protected]> AuthorDate: Sat Sep 13 02:33:06 2008 -0700Committer: Linus Torvalds <[email protected]> CommitDate: Sat Sep 13 14:41:50 2008 -0700(quoted diff) +0
-1if (strcmp(tmp->name, dp->name) == 0) { - printk(KERN_WARNING "proc_dir_entry '%s'already "
(quoted diff) +1
-1- "registered\n", dp->name); + printk(KERN_WARNING "proc_dir_entry '%s/%s'already registered\n",
Review
Quoted 3 lines
(quoted diff) +1
-0+ dir->name, dp->name); dump_stack(); break;
Hi Linus, Alexey,
when doing this change, might as well turn it into a WARN() instead; that way kerneloops.org can collect these, and in addition, it uses then a more standard form of reporting (including filename/line number etc)
so how about this:
Quoted 1 line
From
7b907eb010b308c1a41871ea1b6ffb79d2538f01Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
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
--- fs/proc/generic.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
fs/proc/generic.c +1 -2
@@ -547,9 +547,8 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dpfor (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 ; }
Signature · 8 lines
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