From: Arjan van de Ven <arjan@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@tglx.de
Subject: Re: [patch] Printk kernel version in WARN_ON
Date: Sat, 17 Nov 2007 11:35:01 -0800 [thread overview]
Message-ID: <20071117113501.5e3e0d43@laptopd505.fenrus.org> (raw)
In-Reply-To: <20071117104652.8240af62.akpm@linux-foundation.org>
On Sat, 17 Nov 2007 10:46:52 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
> > by ... not too much at least, gcc ought to be quite good at merging
> > same-strings into one, so it's just one extra pointer argument
> >
>
> I think I knew that. At 1000 callsites.
ok so how about putting the same into dump_stack() instead? (see below)
added bonus is that it's now present for all dumps that use
dump_stack(), not just WARN_ON()
(the format I copied from the exact line used by oopses)
Subject: printk kernel version in WARN_ON and other dump_stack users
From: Arjan van de Ven <arjan@linux.intel.com>
today, all oopses contain a version number of the kernel, which is nice
because the people who actually do bother to read the oops get this
vital bit of information always without having to ask the reporter in
another round trip.
However, WARN_ON() and many other dump_stack() users right now lack this
information; the patch below adds this. This information is essential for
getting people to use their time effectively when looking at these things;
in addition, it's essential for tools that try to collect statistics about defects.
Please consider, maybe even for 2.6.24 since its so simple and
important for long term quality processes
The code is identical between 32/64 bit; a lot of this code should be unified over time,
the patch keeps the identical-ness in tact.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
--- linux-2.6.24-rc3/arch/x86/kernel/traps_32.c.org 2007-11-17 11:26:17.000000000 -0800
+++ linux-2.6.24-rc3/arch/x86/kernel/traps_32.c 2007-11-17 11:29:12.000000000 -0800
@@ -283,6 +283,11 @@ void dump_stack(void)
{
unsigned long stack;
+ printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+ current->pid, current->comm, print_tainted(),
+ init_utsname()->release,
+ (int)strcspn(init_utsname()->version, " "),
+ init_utsname()->version);
show_trace(current, NULL, &stack);
}
--- linux-2.6.24-rc3/arch/x86/kernel/traps_64.c.org 2007-11-17 11:26:25.000000000 -0800
+++ linux-2.6.24-rc3/arch/x86/kernel/traps_64.c 2007-11-17 11:29:22.000000000 -0800
@@ -400,6 +400,12 @@ void show_stack(struct task_struct *tsk,
void dump_stack(void)
{
unsigned long dummy;
+
+ printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+ current->pid, current->comm, print_tainted(),
+ init_utsname()->release,
+ (int)strcspn(init_utsname()->version, " "),
+ init_utsname()->version);
show_trace(NULL, NULL, &dummy);
}
--
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2007-11-17 19:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 18:15 Arjan van de Ven
2007-11-17 18:27 ` Andrew Morton
2007-11-17 18:39 ` Arjan van de Ven
2007-11-17 18:46 ` Andrew Morton
2007-11-17 19:35 ` Arjan van de Ven [this message]
2007-11-17 19:42 ` Sam Ravnborg
2007-11-21 12:51 ` Pavel Machek
2007-11-18 0:42 ` Ingo Molnar
2007-11-18 0:57 ` Andrew Morton
2007-11-18 1:04 ` Ingo Molnar
2007-11-18 17:18 ` Arjan van de Ven
2007-11-17 19:28 ` Sam Ravnborg
2007-11-17 23:02 ` Denys Vlasenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071117113501.5e3e0d43@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@tglx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®