From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-ia64@vger.kernel.org, linuxppc-dev@ozlabs.org,
Peter Anvin <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
Arjan van de Ven <arjan@linux.intel.com>,
"David S. Miller" <davem@davemloft.net>,
parisc-linux@parisc-linux.org
Subject: Re: the printk problem
Date: Sun, 6 Jul 2008 07:27:41 +0200 [thread overview]
Message-ID: <20080706052741.GA18928@elte.hu> (raw)
In-Reply-To: <alpine.LFD.1.10.0807051523180.2847@woody.linux-foundation.org>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > Still all happily untested, of course. And still with no actual
> > users converted.
>
> Ok, it's tested, and here's an example usage conversion.
>
> The diffstat pretty much says it all. It _does_ change the format of
> the stack trace entry a bit, but I don't think it's for the worse
> (unless it breaks things like the oops tracker - Arjan?)
>
> It changes the symbol-in-module format from
>
> :ext3:add_dirent_to_buf+0x6c/0x26c
>
> to
>
> add_dirent_to_buf+0x6c/0x26c [ext3]
>
> but quite frankly, the latter was the standard format anyway (it's
> what "sprint_symbol()" gives you), and traps_64.c was the odd man out.
>
> In fact, traps_32.c already uses the standard print_symbol() format,
> so it really was an issue of the 64-bit code being odd (and I assume
> that this also means that it cannot break the oops tracker, since it
> already had to be able to handle both formats).
>
> I also removed the KALLSYMS dependency, so if KALLSYMS isn't enabled
> it will now give the same hex format twice, but I doubt we really care
> (such stack traces are unreadable whether it shows up once or twice,
> and the simplicity is worth it).
>
> If people do just a few more conversions like this, then the 52 added
> lines in lib/vsnprintf.c are more than made up for by removed lines
> elsewhere (and more readable source code).
applied (with the commit message below) to tip/x86/debug for v2.6.27
merging, thanks Linus. Can i add your SOB too?
Ingo
-------------------->
commit 4afd2534d6d4a77f4b7497c92f1ff7528d8f4eaa
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat Jul 5 15:32:41 2008 -0700
x86, 64-bit: standardize printk_address()
Changes the symbol-in-module format from
:ext3:add_dirent_to_buf+0x6c/0x26c
to
add_dirent_to_buf+0x6c/0x26c [ext3]
the latter was the standard format anyway (it's what "sprint_symbol()"
gives you), and traps_64.c was the odd man out.
In fact, traps_32.c already uses the standard print_symbol() format, so
it really was an issue of the 64-bit code being odd (and I assume that
this also means that it cannot break the oops tracker, since it already
had to be able to handle both formats).
I also removed the KALLSYMS dependency, so if KALLSYMS isn't enabled it
will now give the same hex format twice, but I doubt we really care
(such stack traces are unreadable whether it shows up once or twice, and
the simplicity is worth it).
If people do just a few more conversions like this, then the 52 added
lines in lib/vsnprintf.c are more than made up for by removed lines
elsewhere (and more readable source code).
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index adff76e..f1a95d1 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -104,30 +104,7 @@ int kstack_depth_to_print = 12;
void printk_address(unsigned long address, int reliable)
{
-#ifdef CONFIG_KALLSYMS
- unsigned long offset = 0, symsize;
- const char *symname;
- char *modname;
- char *delim = ":";
- char namebuf[KSYM_NAME_LEN];
- char reliab[4] = "";
-
- symname = kallsyms_lookup(address, &symsize, &offset,
- &modname, namebuf);
- if (!symname) {
- printk(" [<%016lx>]\n", address);
- return;
- }
- if (!reliable)
- strcpy(reliab, "? ");
-
- if (!modname)
- modname = delim = "";
- printk(" [<%016lx>] %s%s%s%s%s+0x%lx/0x%lx\n",
- address, reliab, delim, modname, delim, symname, offset, symsize);
-#else
- printk(" [<%016lx>]\n", address);
-#endif
+ printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address);
}
static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
next prev parent reply other threads:[~2008-07-06 5:29 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080625131101.GA6205@digi.com>
[not found] ` <20080704104634.GA31634@digi.com>
[not found] ` <20080704111540.ddffd241.akpm@linux-foundation.org>
[not found] ` <alpine.LFD.1.10.0807041147450.2815@woody.linux-foundation.org>
2008-07-04 20:02 ` the printk problem Linus Torvalds
2008-07-04 20:27 ` Andrew Morton
2008-07-04 20:41 ` Linus Torvalds
2008-07-04 20:42 ` Matthew Wilcox
2008-07-04 22:01 ` Andrew Morton
2008-07-05 2:03 ` Matthew Wilcox
2008-07-22 10:05 ` [PATCH] Make u64 long long on all architectures (was: the printk problem) Andrew Morton
2008-07-22 10:36 ` Michael Ellerman
2008-07-22 10:53 ` Andrew Morton
2008-07-22 11:36 ` Benjamin Herrenschmidt
2008-07-22 11:35 ` Benjamin Herrenschmidt
2008-07-05 10:20 ` the printk problem Denys Vlasenko
2008-07-05 11:33 ` Jan Engelhardt
2008-07-05 12:52 ` Vegard Nossum
2008-07-05 13:24 ` Jan Engelhardt
2008-07-05 13:50 ` Vegard Nossum
2008-07-05 14:07 ` Jan Engelhardt
2008-07-05 17:56 ` Linus Torvalds
2008-07-05 18:40 ` Jan Engelhardt
2008-07-05 18:44 ` Linus Torvalds
2008-07-05 18:41 ` Vegard Nossum
2008-07-05 18:52 ` Matthew Wilcox
2008-07-06 0:02 ` Pekka Enberg
2008-07-06 5:17 ` Randy Dunlap
2008-07-04 22:58 ` Benjamin Herrenschmidt
2008-07-04 20:36 ` Matthew Wilcox
2008-07-08 1:44 ` Kyle McMartin
2008-07-04 23:00 ` Benjamin Herrenschmidt
2008-07-04 23:25 ` Linus Torvalds
2008-07-05 22:32 ` Linus Torvalds
2008-07-05 22:57 ` Arjan van de Ven
2008-07-06 5:27 ` Ingo Molnar [this message]
2008-07-06 5:37 ` Linus Torvalds
2008-07-06 5:53 ` Ingo Molnar
2008-07-06 6:13 ` Ingo Molnar
2008-07-07 1:14 ` Benjamin Herrenschmidt
2008-07-07 3:26 ` Stephen Rothwell
2008-07-07 3:28 ` Michael Ellerman
2008-07-07 4:59 ` Stephen Rothwell
2008-07-07 3:43 ` Benjamin Herrenschmidt
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=20080706052741.GA18928@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=parisc-linux@parisc-linux.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).