* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
@ 2008-06-25 8:56 Marco Cesati
0 siblings, 0 replies; 27+ messages in thread
From: Marco Cesati @ 2008-06-25 8:56 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, hpa, yhlu.kernel, akpm, mingo, tglx, steiner,
travis, linux-kernel, ying.huang, andi
On Tue, 24 Jun 2008, Linus Torvalds wrote:
> > I'd be inclined instead to use "%P" for symbolic addrs.
> That doesn't work - gcc warns about it.
>
> That turns out to be a problem with %#p too.
I believe that using "%-p" instead of "%#p" would work.
The canonical meaning of "%-p" should be the very same as
"%p", but gcc should not complain because it is
ready to parse a format string like "%-10p" (which is of
course different than "%10p").
A bit too tricky, perhaps?!
Tested on gcc 4.1.2.
Marco
--
Marco Cesati <cesati@uniroma2.it>
Universita' degli Studi di Roma Tor Vergata - DISP
via del Politecnico 1, 00133 Roma
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 15:19 ` Linus Torvalds
2008-06-25 15:34 ` Johannes Berg
2008-06-27 20:43 ` Denys Vlasenko
@ 2008-06-30 7:58 ` Alexander van Heukelum
2 siblings, 0 replies; 27+ messages in thread
From: Alexander van Heukelum @ 2008-06-30 7:58 UTC (permalink / raw)
To: Linus Torvalds, Johannes Berg
Cc: Paul Jackson, H. Peter Anvin, yhlu.kernel, Andrew Morton,
Ingo Molnar, Thomas Gleixner, steiner, travis, linux-kernel,
ying.huang, Andi Kleen
On Wed, 25 Jun 2008 08:19:13 -0700 (PDT), "Linus Torvalds"
<torvalds@linux-foundation.org> said:
> On Wed, 25 Jun 2008, Johannes Berg wrote:
> >
> > In networking, we've gone through various incarnations of print_mac()
> > which is similar to the sym() macro Paul proposed, and it turned out to
> > be undesirable because of the way it interacts with static inlines that
> > only optionally contain code at all, the print_mac() function call is
> > still emitted by the compiler. People experimented with marking it
> > __pure but that had other problems.
>
> You don't even have to go that esoteric.
>
> Just printing things like "sector_t" or "u64" is painful, because the
> exact type depends on config options and/or architecture.
>
> > It would be nice to be able to say
> >
> > u8 *eaddr;
> >
> > printk(... %M ..., eaddr);
>
> For special things, I do think we should extend the format more, and
> forget about single-character names. It would be lovely to do them as
> %[mac], %[u64], %[symbol] or similar. Because once you don't rely on gcc
> checking the string, you can do it.
That would confuse the gcc format string checking... A solution that
just crossed my mind is leaving the format string as is (i.e., "%p"),
but prepending it with a special linux-specific string which does not
confuse gcc. Like: "&mac%p"... for simplicity & can be considered always
special in printk, and && can stand for a literal &. (or pick any
other character that is not used frequently in format strings and is
not %, of course.)
> The problem is that right now we absolutely _do_ rely on gcc checking the
> string, and as such we're forced to use standard patterns, and standard
> patterns _only_. And that means that %M isn't an option, but also that if
> we want symbolic names we'd have to use %p, and not some extension.
"&%p" could then be used for a symbol-lookup.
It doesn't help u64, though, but isn't it about time to unify u64 to
"unsigned long long" everywhere, anyhow? Is there any argument against
that except that a big sweep is necessary to clean up new warnings due
to printk format strings?
Greetings,
Alexander
> But once you drop the 'standard patterns' requirement, I do think you
> should drop it _entirely_, and not just extend it with some pissant
> single-character unreadable mess.
>
> Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>
--
Alexander van Heukelum
heukelum@fastmail.fm
--
http://www.fastmail.fm - IMAP accessible web-mail
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-27 12:00 ` Ingo Molnar
@ 2008-06-27 21:25 ` Sam Ravnborg
0 siblings, 0 replies; 27+ messages in thread
From: Sam Ravnborg @ 2008-06-27 21:25 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Paul Jackson, hpa, yhlu.kernel, akpm, tglx,
steiner, travis, linux-kernel, ying.huang, andi, Vegard Nossum
> >
> > For each Makefile (does not apply recursively):
> > ccflags-$(CONFIG_PROMOTE_WARNINGS_TO_ERROR) += -Werror
> >
> > When I get around to it:
> > ccflags-sched.o-$(CONFIG_PROMOTE_WARNINGS_TO_ERROR) += -Werror
>
> if there's a generic kbuild facility for it i'd love to try something
> like that out, on files that i maintain. There should perhaps be a
> shortcut for it? Something like:
>
> ccflags-sched.o += -Werror
>
> and kbuild would decide whether CONFIG_PROMOTE_WARNINGS_TO_ERROR is set
> and whether to filter out -Werror or not?
I would prefer to have a simpler CONFIG name and then
use the generic version.
So something like:
ccflags-sched.o-$(CONFIG_CC_Werror) += -Werror
It is in the above line obvious that we for sched.o add the -Werror
option if the CONFIG option CC_Werror is y.
Sam
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 15:19 ` Linus Torvalds
2008-06-25 15:34 ` Johannes Berg
@ 2008-06-27 20:43 ` Denys Vlasenko
2008-06-30 7:58 ` Alexander van Heukelum
2 siblings, 0 replies; 27+ messages in thread
From: Denys Vlasenko @ 2008-06-27 20:43 UTC (permalink / raw)
To: Linus Torvalds
Cc: Johannes Berg, Paul Jackson, hpa, yhlu.kernel, akpm, mingo, tglx,
steiner, travis, linux-kernel, ying.huang, andi
On Wednesday 25 June 2008 17:19, Linus Torvalds wrote:
> The problem is that right now we absolutely _do_ rely on gcc checking the
> string, and as such we're forced to use standard patterns, and standard
> patterns _only_.
Can we have alternative printk?
asmlinkage int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2))) __cold;
+asmlinkage int custom_printk(const char * fmt, ...) __cold asm ("printk");
There you go. custom_printk() will not be checked by gcc.
No runtime overhead.
> And that means that %M isn't an option, but also that if
> we want symbolic names we'd have to use %p, and not some extension.
>
> But once you drop the 'standard patterns' requirement, I do think you
> should drop it _entirely_, and not just extend it with some pissant
> single-character unreadable mess.
It still makes sense to have some more common ones as single char
for size reasons.
--
vda
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-26 19:14 ` Sam Ravnborg
@ 2008-06-27 12:00 ` Ingo Molnar
2008-06-27 21:25 ` Sam Ravnborg
0 siblings, 1 reply; 27+ messages in thread
From: Ingo Molnar @ 2008-06-27 12:00 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Linus Torvalds, Paul Jackson, hpa, yhlu.kernel, akpm, tglx,
steiner, travis, linux-kernel, ying.huang, andi, Vegard Nossum
* Sam Ravnborg <sam@ravnborg.org> wrote:
> Hi Ingo
>
> > Sparse is a cool tool that extends upon C types (and more), but it's
> > been made too hard to use widely:
> >
> > - right now it's opt-in with no ability for testers to use it
> > transparently while also building the kernel. Forcing a second
> > kernel build just for 'debugging' reduces the userbase.
>
> This is waht make C=1 is for. If this is broken then we should
> fix it.
> Just trying it out:
> $ make C=1 kernel/sched.o
> CHECK kernel/sched.c
> kernel/sched_fair.c:37:14: warning: symbol 'sysctl_sched_latency' was not declar ed. Should it be static?
> kernel/sched_fair.c:43:14: warning: symbol 'sysctl_sched_min_granularity' was no t declared. Should it be static?
> kernel/sched_fair.c:72:14: warning: symbol 'sysctl_sched_wakeup_granularity' was not declared. Should it be static?
> ...
> CC kernel/sched.o
>
>
> So make C=1 works as intended and let you run sparse on the files that
> are built - and only those.
ah, ok - i was confused about that.
> > Fortunately these problems are all solvable gradually:
> >
> > - a kbuild mechanism to get _parallel_ Sparse checks. I.e. both the
> > real .o gets produced but also the "make C=1" output is produced.
> > Testers would be enabled to do Sparse checks "alongside" of a normal
> > kernel build. (Sparse is plenty fast for this to be practical)
> Already present.
>
> >
> > - kbuild mechanism with which subsystem maintainers could mark specific
> > files (or all of their subdirectories) of their subsystem as to be
> > Sparse-checked by default. [if a .config debug option is enabled]
> > For example we'd mark all of arch/x86/*.o and kernel/sched*.o in such
> > a way for example.
> That would then be on a directory basis.
> You can do:
> diff --git a/kernel/Makefile b/kernel/Makefile
> index 1c9938a..1ba00aa 100644
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -2,6 +2,7 @@
> # Makefile for the linux kernel.
> #
>
> +KBUILD_CHECKSRC=1
> obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
> exit.o itimer.o time.o softirq.o resource.o \
> sysctl.o capability.o ptrace.o timer.o user.o \
>
> already today.
> It applies recursively so we will then run sparse on kernel/time/*.o too.
>
> There is no easy way to cover all of arch/x86/*.o as the files are distributed
> in several Makefiles and there is no common one.
>
> >
> > - a second layer would be very useful as well: failures would turn into
> > build failures if a debug .config switch is enabled.
> This could be a simple:
> ifdef CONFIG_CHECK_IS_ERROR
> CHECKFLAGS += -Werror
> endif
>
> And teach sparse about -Werror
>
> > On a similar note, it would be nice if subsystem maintainers had a
> > kbuild mechanism to have the fails they maintain to be built via -Werr
> > (if an opt-in .config option is enabled).
>
> For each Makefile (does not apply recursively):
> ccflags-$(CONFIG_PROMOTE_WARNINGS_TO_ERROR) += -Werror
>
> When I get around to it:
> ccflags-sched.o-$(CONFIG_PROMOTE_WARNINGS_TO_ERROR) += -Werror
if there's a generic kbuild facility for it i'd love to try something
like that out, on files that i maintain. There should perhaps be a
shortcut for it? Something like:
ccflags-sched.o += -Werror
and kbuild would decide whether CONFIG_PROMOTE_WARNINGS_TO_ERROR is set
and whether to filter out -Werror or not?
Ingo
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 14:53 ` Ingo Molnar
@ 2008-06-26 19:14 ` Sam Ravnborg
2008-06-27 12:00 ` Ingo Molnar
0 siblings, 1 reply; 27+ messages in thread
From: Sam Ravnborg @ 2008-06-26 19:14 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Paul Jackson, hpa, yhlu.kernel, akpm, tglx,
steiner, travis, linux-kernel, ying.huang, andi, Vegard Nossum
Hi Ingo
> Sparse is a cool tool that extends upon C types (and more), but it's
> been made too hard to use widely:
>
> - right now it's opt-in with no ability for testers to use it
> transparently while also building the kernel. Forcing a second
> kernel build just for 'debugging' reduces the userbase.
This is waht make C=1 is for. If this is broken then we should
fix it.
Just trying it out:
$ make C=1 kernel/sched.o
CHECK kernel/sched.c
kernel/sched_fair.c:37:14: warning: symbol 'sysctl_sched_latency' was not declar ed. Should it be static?
kernel/sched_fair.c:43:14: warning: symbol 'sysctl_sched_min_granularity' was no t declared. Should it be static?
kernel/sched_fair.c:72:14: warning: symbol 'sysctl_sched_wakeup_granularity' was not declared. Should it be static?
...
CC kernel/sched.o
So make C=1 works as intended and let you run sparse on the files
that are built - and only those.
> Fortunately these problems are all solvable gradually:
>
> - a kbuild mechanism to get _parallel_ Sparse checks. I.e. both the
> real .o gets produced but also the "make C=1" output is produced.
> Testers would be enabled to do Sparse checks "alongside" of a normal
> kernel build. (Sparse is plenty fast for this to be practical)
Already present.
>
> - kbuild mechanism with which subsystem maintainers could mark specific
> files (or all of their subdirectories) of their subsystem as to be
> Sparse-checked by default. [if a .config debug option is enabled]
> For example we'd mark all of arch/x86/*.o and kernel/sched*.o in such
> a way for example.
That would then be on a directory basis.
You can do:
diff --git a/kernel/Makefile b/kernel/Makefile
index 1c9938a..1ba00aa 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -2,6 +2,7 @@
# Makefile for the linux kernel.
#
+KBUILD_CHECKSRC=1
obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
already today.
It applies recursively so we will then run sparse on kernel/time/*.o too.
There is no easy way to cover all of arch/x86/*.o as the files are distributed
in several Makefiles and there is no common one.
>
> - a second layer would be very useful as well: failures would turn into
> build failures if a debug .config switch is enabled.
This could be a simple:
ifdef CONFIG_CHECK_IS_ERROR
CHECKFLAGS += -Werror
endif
And teach sparse about -Werror
> On a similar note, it would be nice if subsystem maintainers had a
> kbuild mechanism to have the fails they maintain to be built via -Werr
> (if an opt-in .config option is enabled).
For each Makefile (does not apply recursively):
ccflags-$(CONFIG_PROMOTE_WARNINGS_TO_ERROR) += -Werror
When I get around to it:
ccflags-sched.o-$(CONFIG_PROMOTE_WARNINGS_TO_ERROR) += -Werror
Sam
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 15:19 ` Linus Torvalds
@ 2008-06-25 15:34 ` Johannes Berg
2008-06-27 20:43 ` Denys Vlasenko
2008-06-30 7:58 ` Alexander van Heukelum
2 siblings, 0 replies; 27+ messages in thread
From: Johannes Berg @ 2008-06-25 15:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, hpa, yhlu.kernel, akpm, mingo, tglx, steiner,
travis, linux-kernel, ying.huang, andi
[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]
On Wed, 2008-06-25 at 08:19 -0700, Linus Torvalds wrote:
>
> On Wed, 25 Jun 2008, Johannes Berg wrote:
> >
> > In networking, we've gone through various incarnations of print_mac()
> > which is similar to the sym() macro Paul proposed, and it turned out to
> > be undesirable because of the way it interacts with static inlines that
> > only optionally contain code at all, the print_mac() function call is
> > still emitted by the compiler. People experimented with marking it
> > __pure but that had other problems.
>
> You don't even have to go that esoteric.
>
> Just printing things like "sector_t" or "u64" is painful, because the
> exact type depends on config options and/or architecture.
Heh, true, but I have the print_mac() disaster firmly imprinted in my
mind ;)
> > It would be nice to be able to say
> >
> > u8 *eaddr;
> >
> > printk(... %M ..., eaddr);
>
> For special things, I do think we should extend the format more, and
> forget about single-character names. It would be lovely to do them as
> %[mac], %[u64], %[symbol] or similar. Because once you don't rely on gcc
> checking the string, you can do it.
True, that does look a lot better and has less potential for confusion.
> The problem is that right now we absolutely _do_ rely on gcc checking the
> string, and as such we're forced to use standard patterns, and standard
> patterns _only_. And that means that %M isn't an option, but also that if
> we want symbolic names we'd have to use %p, and not some extension.
>
> But once you drop the 'standard patterns' requirement, I do think you
> should drop it _entirely_, and not just extend it with some pissant
> single-character unreadable mess.
Oh yes, I agree. At one point I figured it should be easy enough to
extend gcc with something that allows you to specify the format
character/type to take but alas, such a thing is not possible.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 14:42 ` Linus Torvalds
@ 2008-06-25 15:29 ` H. Peter Anvin
0 siblings, 0 replies; 27+ messages in thread
From: H. Peter Anvin @ 2008-06-25 15:29 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
Linus Torvalds wrote:
>
> On Tue, 24 Jun 2008, H. Peter Anvin wrote:
>> Any reason we can't just re-define %p to print the 0x prefix, just as glibc
>> does? It'd be easy enough to go and sed out all the 0x%p's currently in the
>> kernel.
>
> You didn't listen. I want #p to do the _symbolic_ address. The thing we
> have in the backtraces etc. With nice symbol offset information etc.
>
> The '0x<hex>' thing isn't all that interesting. You can do it by adding
> the '0x' by hand, or by using a cast and using %#lx instead.
>
You're right, I didn't. I still think the 0x%p's and -- even worse --
0x%08lx's (what about 64 bits?!) we currently have *all over the kernel*
suck, but yes, that's a minor problem and getting the symbolic info
would be a very nice thing.
It looks like gcc will warn about just about ever modifier to %p. I
wondered whose diseased brain came up with that idea.
Overall, I think the glibc people have botched their printf extensions
horribly, failing to pick up the very useful %I extension from Windows
and instead using %I for something completely conflicting is
particularly pissy.
-hpa
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 15:00 ` Johannes Berg
@ 2008-06-25 15:19 ` Linus Torvalds
2008-06-25 15:34 ` Johannes Berg
` (2 more replies)
0 siblings, 3 replies; 27+ messages in thread
From: Linus Torvalds @ 2008-06-25 15:19 UTC (permalink / raw)
To: Johannes Berg
Cc: Paul Jackson, hpa, yhlu.kernel, akpm, mingo, tglx, steiner,
travis, linux-kernel, ying.huang, andi
On Wed, 25 Jun 2008, Johannes Berg wrote:
>
> In networking, we've gone through various incarnations of print_mac()
> which is similar to the sym() macro Paul proposed, and it turned out to
> be undesirable because of the way it interacts with static inlines that
> only optionally contain code at all, the print_mac() function call is
> still emitted by the compiler. People experimented with marking it
> __pure but that had other problems.
You don't even have to go that esoteric.
Just printing things like "sector_t" or "u64" is painful, because the
exact type depends on config options and/or architecture.
> It would be nice to be able to say
>
> u8 *eaddr;
>
> printk(... %M ..., eaddr);
For special things, I do think we should extend the format more, and
forget about single-character names. It would be lovely to do them as
%[mac], %[u64], %[symbol] or similar. Because once you don't rely on gcc
checking the string, you can do it.
The problem is that right now we absolutely _do_ rely on gcc checking the
string, and as such we're forced to use standard patterns, and standard
patterns _only_. And that means that %M isn't an option, but also that if
we want symbolic names we'd have to use %p, and not some extension.
But once you drop the 'standard patterns' requirement, I do think you
should drop it _entirely_, and not just extend it with some pissant
single-character unreadable mess.
Linus
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 4:04 ` Linus Torvalds
` (2 preceding siblings ...)
2008-06-25 14:53 ` Ingo Molnar
@ 2008-06-25 15:00 ` Johannes Berg
2008-06-25 15:19 ` Linus Torvalds
3 siblings, 1 reply; 27+ messages in thread
From: Johannes Berg @ 2008-06-25 15:00 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, hpa, yhlu.kernel, akpm, mingo, tglx, steiner,
travis, linux-kernel, ying.huang, andi
[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]
On Tue, 2008-06-24 at 21:04 -0700, Linus Torvalds wrote:
> It's really irritating how we cannot extend on the printk strings without
> either having to throw out gcc warnings altogether. gcc has no extension
> mechanism to the built-in rules ;/
>
> The format warnings are too useful to drop entirely. I guess sparse could
> be taught to do them, and then we could drop the gcc support for them. But
> that would still limit coverage a _lot_.
We should probably start working on getting this fixed.
In networking, we've gone through various incarnations of print_mac()
which is similar to the sym() macro Paul proposed, and it turned out to
be undesirable because of the way it interacts with static inlines that
only optionally contain code at all, the print_mac() function call is
still emitted by the compiler. People experimented with marking it
__pure but that had other problems.
It would be nice to be able to say
u8 *eaddr;
printk(... %M ..., eaddr);
and get
03:45:67:89:ab:cd
out of it, which avoids both the large string/code you get when doing it
manually (printf("%2.x:...:%.2x", eaddr[0], ...) for which there are
macros) and the "function call in hotpath even when debugging is
disabled" problem I mentioned above.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 4:04 ` Linus Torvalds
2008-06-25 5:01 ` H. Peter Anvin
2008-06-25 8:04 ` Paul Jackson
@ 2008-06-25 14:53 ` Ingo Molnar
2008-06-26 19:14 ` Sam Ravnborg
2008-06-25 15:00 ` Johannes Berg
3 siblings, 1 reply; 27+ messages in thread
From: Ingo Molnar @ 2008-06-25 14:53 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, hpa, yhlu.kernel, akpm, tglx, steiner, travis,
linux-kernel, ying.huang, andi, Sam Ravnborg, Vegard Nossum
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> The format warnings are too useful to drop entirely. I guess sparse
> could be taught to do them, and then we could drop the gcc support for
> them. But that would still limit coverage a _lot_.
i think the main problem with Sparse isnt even technical but just a few
minor gotchas IMO that artificially work against the widespread use of
Sparse in various common workflows.
Sparse is a cool tool that extends upon C types (and more), but it's
been made too hard to use widely:
- right now it's opt-in with no ability for testers to use it
transparently while also building the kernel. Forcing a second
kernel build just for 'debugging' reduces the userbase.
- it produces way too much output for people to act upon and see any
real "improvement" in the end result. (Obviously this is partly a
side-effect of its shallow use.) Producing too much output by default
reduces the userbase further.
- delta analysis (watching what new Sparse warnings pop up) is
possible, Al Viro has the "remapper" tool:
git://git.kernel.org/pub/scm/linux/kernel/git/viro/remapper.git/
but forcing delta analysis as the only viable Sparse use poses yet
another barrier against use and does not allow state-less,
single-pass test feedback.
There are simpler tools (like for example checkpatch.pl) which are much
cruder in many aspects, but still they are used much more because they
do not have such basic usage problems. The artificial limitations on
Sparse usage keep it from being the tool it could be, IMO.
A tool that has quality assurance effects _must_ be actionable by a
broad developer base and needs to be no-hassle enabled by testers -
otherwise it will just drown in sheer entropy.
Fortunately these problems are all solvable gradually:
- a kbuild mechanism to get _parallel_ Sparse checks. I.e. both the
real .o gets produced but also the "make C=1" output is produced.
Testers would be enabled to do Sparse checks "alongside" of a normal
kernel build. (Sparse is plenty fast for this to be practical)
- kbuild mechanism with which subsystem maintainers could mark specific
files (or all of their subdirectories) of their subsystem as to be
Sparse-checked by default. [if a .config debug option is enabled]
For example we'd mark all of arch/x86/*.o and kernel/sched*.o in such
a way for example.
- a second layer would be very useful as well: failures would turn into
build failures if a debug .config switch is enabled.
this (and i'm sure some other, simple measures) would push Sparse into
the mainstream and it would allow us to integrate it into existing
practices of automated testing.
if we did all that Sparse might even turn into the native, built-in
Linux kernel compiler of the future: it already has the hardest bit
implemented as it can parse the kernel source and generates syntax trees
from it, generating a real .o from it is just one next step.
On a similar note, it would be nice if subsystem maintainers had a
kbuild mechanism to have the fails they maintain to be built via -Werr
(if an opt-in .config option is enabled).
I'd enforce it in a heartbeat on all files i'm involved with - but i
cannot enforce it on the more than 10,000 files the kernel has. Grepping
the warnings of files i'm interested is not possible reliably from make
-j builds.
So if someone wants me to try a kbuild patch to that end, i'd love to
give it a shot :-)
Ingo
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 5:01 ` H. Peter Anvin
@ 2008-06-25 14:42 ` Linus Torvalds
2008-06-25 15:29 ` H. Peter Anvin
0 siblings, 1 reply; 27+ messages in thread
From: Linus Torvalds @ 2008-06-25 14:42 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Paul Jackson, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
On Tue, 24 Jun 2008, H. Peter Anvin wrote:
>
> Any reason we can't just re-define %p to print the 0x prefix, just as glibc
> does? It'd be easy enough to go and sed out all the 0x%p's currently in the
> kernel.
You didn't listen. I want #p to do the _symbolic_ address. The thing we
have in the backtraces etc. With nice symbol offset information etc.
The '0x<hex>' thing isn't all that interesting. You can do it by adding
the '0x' by hand, or by using a cast and using %#lx instead.
Linus
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 4:04 ` Linus Torvalds
2008-06-25 5:01 ` H. Peter Anvin
@ 2008-06-25 8:04 ` Paul Jackson
2008-06-25 14:53 ` Ingo Molnar
2008-06-25 15:00 ` Johannes Berg
3 siblings, 0 replies; 27+ messages in thread
From: Paul Jackson @ 2008-06-25 8:04 UTC (permalink / raw)
To: Linus Torvalds
Cc: hpa, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
Linux, replying to pj:
> > I'd be inclined instead to use "%P" for symbolic addrs.
>
> That doesn't work - gcc warns about it.
>
> That turns out to be a problem with %#p too.
Ah so.
How about the following "sym(addr, buf)" macro? This could make it
more practical to include kernel symbols within ordinary printk's.
On a silly little test with:
{
char b1[32], b2[32], b3[32];
printk(">>>>>> Testing sym(): A. %s, B. %s, C. %s\n",
sym(&pid_max, b1),
sym(0xffffffff80615750, b2), /* an addr in my System.map */
sym(0, b3));
}
the kernel printed:
>>>>>> Testing sym(): A. pid_max+0x0/0x4, B. trampoline_base+0x0/0x10, C. 0x0
===========================================================================
--- linux.orig/include/linux/kallsyms.h 2008-06-23 15:16:49.885666712 -0700
+++ linux/include/linux/kallsyms.h 2008-06-25 00:48:09.446807842 -0700
@@ -32,6 +32,12 @@ extern int sprint_symbol(char *buffer, u
/* Look up a kernel symbol and print it to the kernel messages. */
extern void __print_symbol(const char *fmt, unsigned long address);
+/* Convert address to kernel symbol; can printk result with "%s" format */
+#define sym(address, namebuf) ({ \
+ sprint_symbol((namebuf), (unsigned long)(address)); \
+ (namebuf); \
+})
+
int lookup_symbol_name(unsigned long addr, char *symname);
int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 2:58 ` Linus Torvalds
2008-06-25 3:00 ` Linus Torvalds
2008-06-25 3:08 ` Paul Jackson
@ 2008-06-25 5:05 ` H. Peter Anvin
2 siblings, 0 replies; 27+ messages in thread
From: H. Peter Anvin @ 2008-06-25 5:05 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
Linus Torvalds wrote:
>
> And yes, to avoid messing with current users, maybe we should only do that
> with %#p (which I don't think anybody uses right now, although I suspect
> it actually adds the '0x' you'd like). The '#' thing is, of course, all
> about 'alternate forms'. But I worry that gcc warns about undefined
> formatting behavior.
>
FWIW, I did a pass over the tree stripping out all the 0x%p's and
changing the behaviour about a year ago. It ended up sitting around and
not be submitted, but I'd be happy to re-do it.
-hpa
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 4:04 ` Linus Torvalds
@ 2008-06-25 5:01 ` H. Peter Anvin
2008-06-25 14:42 ` Linus Torvalds
2008-06-25 8:04 ` Paul Jackson
` (2 subsequent siblings)
3 siblings, 1 reply; 27+ messages in thread
From: H. Peter Anvin @ 2008-06-25 5:01 UTC (permalink / raw)
To: Linus Torvalds
Cc: Paul Jackson, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
Linus Torvalds wrote:
>
> On Tue, 24 Jun 2008, Paul Jackson wrote:
>> I'd be inclined instead to use "%P" for symbolic addrs.
>
> That doesn't work - gcc warns about it.
>
> That turns out to be a problem with %#p too.
>
> It's really irritating how we cannot extend on the printk strings without
> either having to throw out gcc warnings altogether. gcc has no extension
> mechanism to the built-in rules ;/
>
> The format warnings are too useful to drop entirely. I guess sparse could
> be taught to do them, and then we could drop the gcc support for them. But
> that would still limit coverage a _lot_.
>
Any reason we can't just re-define %p to print the 0x prefix, just as
glibc does? It'd be easy enough to go and sed out all the 0x%p's
currently in the kernel.
-hpa
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 3:08 ` Paul Jackson
@ 2008-06-25 4:04 ` Linus Torvalds
2008-06-25 5:01 ` H. Peter Anvin
` (3 more replies)
0 siblings, 4 replies; 27+ messages in thread
From: Linus Torvalds @ 2008-06-25 4:04 UTC (permalink / raw)
To: Paul Jackson
Cc: hpa, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
On Tue, 24 Jun 2008, Paul Jackson wrote:
>
> I'd be inclined instead to use "%P" for symbolic addrs.
That doesn't work - gcc warns about it.
That turns out to be a problem with %#p too.
It's really irritating how we cannot extend on the printk strings without
either having to throw out gcc warnings altogether. gcc has no extension
mechanism to the built-in rules ;/
The format warnings are too useful to drop entirely. I guess sparse could
be taught to do them, and then we could drop the gcc support for them. But
that would still limit coverage a _lot_.
Linus
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 2:58 ` Linus Torvalds
2008-06-25 3:00 ` Linus Torvalds
@ 2008-06-25 3:08 ` Paul Jackson
2008-06-25 4:04 ` Linus Torvalds
2008-06-25 5:05 ` H. Peter Anvin
2 siblings, 1 reply; 27+ messages in thread
From: Paul Jackson @ 2008-06-25 3:08 UTC (permalink / raw)
To: Linus Torvalds
Cc: hpa, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
Linus wrote:
> %#p (which I don't think anybody uses right now
I don't see any such uses, so that could work.
I agree - that the lib/vsprintf.c code seems to prefix
"%#p" numbers with "0x", as currently coded.
But I find borrowing the '#' flag for symbolic names
to be a slight stretch, as well as likely to confuse
some of us, such as myself, for whom these printf flags
are already a tad cryptic and error prone.
I'd be inclined instead to use "%P" for symbolic addrs.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 2:58 ` Linus Torvalds
@ 2008-06-25 3:00 ` Linus Torvalds
2008-06-25 3:08 ` Paul Jackson
2008-06-25 5:05 ` H. Peter Anvin
2 siblings, 0 replies; 27+ messages in thread
From: Linus Torvalds @ 2008-06-25 3:00 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Paul Jackson, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
On Tue, 24 Jun 2008, Linus Torvalds wrote:
>
> And yes, to avoid messing with current users, maybe we should only do that
> with %#p (which I don't think anybody uses right now, although I suspect
> it actually adds the '0x' you'd like). The '#' thing is, of course, all
> about 'alternate forms'. But I worry that gcc warns about undefined
> formatting behavior.
Indeed it does, I just checked. Very irritating.
Linus
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 2:18 ` H. Peter Anvin
@ 2008-06-25 2:58 ` Linus Torvalds
2008-06-25 3:00 ` Linus Torvalds
` (2 more replies)
0 siblings, 3 replies; 27+ messages in thread
From: Linus Torvalds @ 2008-06-25 2:58 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Paul Jackson, yhlu.kernel, akpm, mingo, tglx, steiner, travis,
linux-kernel, ying.huang, andi
On Tue, 24 Jun 2008, H. Peter Anvin wrote:
>
> What we really should have is %p produce this format. For some odd reason,
> right now %p produces numbers without the 0x prefix.
Actually, I'd like to make %p produce the format that you right now have
to jump through insane hoops for: symbolic addresses.
Right now you have to do something insane like
print_symbol(KERN_WARNING "address: %s\n", ptr);
to print a symbolic version, and it sucks because it's actually just able
to print symbols, you cannot mix any other types in there.
I think it would be much easier to use if "%p" just did the symbolic
version (if it's relevant) automatically. If you _just_ want the hex
representation, you can already always just use %#lx and a cast.
(Of course, then for things that we can't make into symbolic names, we'd
have to fall back to just the hex representation, and whether that one
then includes the 0x or not I don't have strong opinions on.)
And yes, to avoid messing with current users, maybe we should only do that
with %#p (which I don't think anybody uses right now, although I suspect
it actually adds the '0x' you'd like). The '#' thing is, of course, all
about 'alternate forms'. But I worry that gcc warns about undefined
formatting behavior.
Linus
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 2:17 ` Paul Jackson
@ 2008-06-25 2:18 ` H. Peter Anvin
2008-06-25 2:58 ` Linus Torvalds
0 siblings, 1 reply; 27+ messages in thread
From: H. Peter Anvin @ 2008-06-25 2:18 UTC (permalink / raw)
To: Paul Jackson
Cc: yhlu.kernel, akpm, mingo, tglx, steiner, travis, linux-kernel,
ying.huang, andi
Paul Jackson wrote:
> hpa wrote:
>> that would have to be %#10lx.
>
> Hmmm ... the '#' is a good idea, instead of an explicit "0x".
>
> Do we want zero padding as well, with "0#8lx" ?
>
> Zone PFN ranges:
> DMA 0x00000000 -> 0x00001000
> DMA32 0x00001000 -> 0x00100000
> Normal 0x00100000 -> 0x00428000
>
> or right aligned, space padded:
>
> Zone PFN ranges:
> DMA 0x0 -> 0x1000
> DMA32 0x1000 -> 0x100000
> Normal 0x100000 -> 0x428000
>
> I like the zero padding here myself.
>
Yes, zero padding.
What we really should have is %p produce this format. For some odd
reason, right now %p produces numbers without the 0x prefix.
-h
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 1:56 ` H. Peter Anvin
@ 2008-06-25 2:17 ` Paul Jackson
2008-06-25 2:18 ` H. Peter Anvin
0 siblings, 1 reply; 27+ messages in thread
From: Paul Jackson @ 2008-06-25 2:17 UTC (permalink / raw)
To: H. Peter Anvin
Cc: yhlu.kernel, akpm, mingo, tglx, steiner, travis, linux-kernel,
ying.huang, andi
hpa wrote:
> that would have to be %#10lx.
Hmmm ... the '#' is a good idea, instead of an explicit "0x".
Do we want zero padding as well, with "0#8lx" ?
Zone PFN ranges:
DMA 0x00000000 -> 0x00001000
DMA32 0x00001000 -> 0x00100000
Normal 0x00100000 -> 0x00428000
or right aligned, space padded:
Zone PFN ranges:
DMA 0x0 -> 0x1000
DMA32 0x1000 -> 0x100000
Normal 0x100000 -> 0x428000
I like the zero padding here myself.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-25 1:32 ` Paul Jackson
@ 2008-06-25 1:56 ` H. Peter Anvin
2008-06-25 2:17 ` Paul Jackson
0 siblings, 1 reply; 27+ messages in thread
From: H. Peter Anvin @ 2008-06-25 1:56 UTC (permalink / raw)
To: Paul Jackson
Cc: Yinghai Lu, akpm, mingo, tglx, steiner, travis, linux-kernel,
ying.huang, andi
Paul Jackson wrote:
> Yinghai wrote:
>> Zone PFN ranges:
>> DMA 0x 0 -> 0x 1000
>
> Aha - you're right!
>
> I just earned the Ugly Patch of the Day Award.
>
> I think changes of "%lu" to "0x%lx" are still ok,
> but changes of "%8lu" to "0x%8lx" (which use 8
> columns, right aligned, space filled format) are
> not ok.
>
No, that would have to be %#10lx.
-hpa
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-24 21:29 ` Yinghai Lu
@ 2008-06-25 1:32 ` Paul Jackson
2008-06-25 1:56 ` H. Peter Anvin
0 siblings, 1 reply; 27+ messages in thread
From: Paul Jackson @ 2008-06-25 1:32 UTC (permalink / raw)
To: Yinghai Lu
Cc: akpm, mingo, tglx, steiner, travis, hpa, linux-kernel, ying.huang, andi
Yinghai wrote:
> Zone PFN ranges:
> DMA 0x 0 -> 0x 1000
Aha - you're right!
I just earned the Ugly Patch of the Day Award.
I think changes of "%lu" to "0x%lx" are still ok,
but changes of "%8lu" to "0x%8lx" (which use 8
columns, right aligned, space filled format) are
not ok.
I will redo this patch, without the "0x" prefix
on the space filled fields. Let me know if that
is better.
Thank-you.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-23 11:09 ` Paul Jackson
@ 2008-06-24 21:29 ` Yinghai Lu
2008-06-25 1:32 ` Paul Jackson
0 siblings, 1 reply; 27+ messages in thread
From: Yinghai Lu @ 2008-06-24 21:29 UTC (permalink / raw)
To: Paul Jackson
Cc: akpm, mingo, tglx, steiner, travis, hpa, linux-kernel, ying.huang, andi
On Mon, Jun 23, 2008 at 4:09 AM, Paul Jackson <pj@sgi.com> wrote:
> Yinghai wrote:
>> we should remove 0x,
>
> I see some kernel hex prints either way, with or without, 0x.
>
> In this case, in part because I was changing a decimal to a hex
> format, and because it could be ambiguous (a hex number that
> happened to use only [0-9] digits would be indistinguisable from
> a decimal) I preferred using the 0x.
>
> I see no clear answer here ... it seems to be a matter of taste.
>
>> we should ... hex print out all the way...regarding mem pfn and
>> memory address, memory size etc. except XXXMB. XXXKB...
>
> I fixed the ones I noticed. If you see print formats that you
> would like to change, I will likely be in agreement to such a
> patch.
got
Zone PFN ranges:
DMA 0x 0 -> 0x 1000
DMA32 0x 1000 -> 0x 100000
Normal 0x 100000 -> 0x 428000
Movable zone start PFN for each node
early_node_map[5] active PFN ranges
0: 0x 0 -> 0x 99
0: 0x 100 -> 0x d7fa0
0: 0x d7fae -> 0x d7fb0
0: 0x 100000 -> 0x 228000
1: 0x 228000 -> 0x 428000
YH
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-22 19:38 ` Yinghai Lu
@ 2008-06-23 11:09 ` Paul Jackson
2008-06-24 21:29 ` Yinghai Lu
0 siblings, 1 reply; 27+ messages in thread
From: Paul Jackson @ 2008-06-23 11:09 UTC (permalink / raw)
To: Yinghai Lu
Cc: akpm, mingo, tglx, steiner, travis, hpa, linux-kernel, ying.huang, andi
Yinghai wrote:
> we should remove 0x,
I see some kernel hex prints either way, with or without, 0x.
In this case, in part because I was changing a decimal to a hex
format, and because it could be ambiguous (a hex number that
happened to use only [0-9] digits would be indistinguisable from
a decimal) I preferred using the 0x.
I see no clear answer here ... it seems to be a matter of taste.
> we should ... hex print out all the way...regarding mem pfn and
> memory address, memory size etc. except XXXMB. XXXKB...
I fixed the ones I noticed. If you see print formats that you
would like to change, I will likely be in agreement to such a
patch.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-22 14:22 ` [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks Paul Jackson
@ 2008-06-22 19:38 ` Yinghai Lu
2008-06-23 11:09 ` Paul Jackson
0 siblings, 1 reply; 27+ messages in thread
From: Yinghai Lu @ 2008-06-22 19:38 UTC (permalink / raw)
To: Paul Jackson, Andrew Morton, Ingo Molnar
Cc: Thomas Gleixner, Jack Steiner, Mike Travis, H. Peter Anvin,
linux-kernel, Huang, Ying, Andi Kleen
On Sun, Jun 22, 2008 at 7:22 AM, Paul Jackson <pj@sgi.com> wrote:
> From: Paul Jackson <pj@sgi.com>
>
> Page frame numbers (the portion of physical addresses above the low
> order page offsets) are displayed in several kernel debug and info
> prints in decimal, not hex. Decimal addresse are unreadable. Use hex.
>
> Signed-off-by: Paul Jackson <pj@sgi.com>
>
> ---
> arch/x86/kernel/e820.c | 2 +-
> arch/x86/mm/init_64.c | 2 +-
> mm/page_alloc.c | 6 +++---
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> --- linux-next.orig/arch/x86/kernel/e820.c 2008-06-22 06:36:07.203937695 -0700
> +++ linux-next/arch/x86/kernel/e820.c 2008-06-22 06:36:16.792519156 -0700
> @@ -922,7 +922,7 @@ unsigned long __init e820_end_of_ram(voi
> if (last_pfn > end_user_pfn)
> last_pfn = end_user_pfn;
>
> - printk(KERN_INFO "last_pfn = %lu max_arch_pfn = %lu\n",
> + printk(KERN_INFO "last_pfn = 0x%lx max_arch_pfn = 0x%lx\n",
we should remove 0x,
and hex print out all the way...regarding mem pfn and memory address,
memory size etc. except XXXMB. XXXKB...
YH
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks
2008-06-22 14:21 [PATCH 0/5 v2] x86 boot: various E820 & EFI related fixes - what changed in v2 Paul Jackson
@ 2008-06-22 14:22 ` Paul Jackson
2008-06-22 19:38 ` Yinghai Lu
0 siblings, 1 reply; 27+ messages in thread
From: Paul Jackson @ 2008-06-22 14:22 UTC (permalink / raw)
To: Ingo Molnar
Cc: Thomas Gleixner, Yinghai Lu, Jack Steiner, Mike Travis,
H. Peter Anvin, linux-kernel, Huang, Ying, Andi Kleen,
Andrew Morton, Paul Jackson
From: Paul Jackson <pj@sgi.com>
Page frame numbers (the portion of physical addresses above the low
order page offsets) are displayed in several kernel debug and info
prints in decimal, not hex. Decimal addresse are unreadable. Use hex.
Signed-off-by: Paul Jackson <pj@sgi.com>
---
arch/x86/kernel/e820.c | 2 +-
arch/x86/mm/init_64.c | 2 +-
mm/page_alloc.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
--- linux-next.orig/arch/x86/kernel/e820.c 2008-06-22 06:36:07.203937695 -0700
+++ linux-next/arch/x86/kernel/e820.c 2008-06-22 06:36:16.792519156 -0700
@@ -922,7 +922,7 @@ unsigned long __init e820_end_of_ram(voi
if (last_pfn > end_user_pfn)
last_pfn = end_user_pfn;
- printk(KERN_INFO "last_pfn = %lu max_arch_pfn = %lu\n",
+ printk(KERN_INFO "last_pfn = 0x%lx max_arch_pfn = 0x%lx\n",
last_pfn, max_arch_pfn);
return last_pfn;
}
--- linux-next.orig/mm/page_alloc.c 2008-06-22 06:35:53.835126994 -0700
+++ linux-next/mm/page_alloc.c 2008-06-22 06:36:16.800519641 -0700
@@ -3517,7 +3517,7 @@ void __init add_active_range(unsigned in
{
int i;
- printk(KERN_DEBUG "Entering add_active_range(%d, %lu, %lu) "
+ printk(KERN_DEBUG "Entering add_active_range(%d, 0x%lx, 0x%lx) "
"%d entries of %d used\n",
nid, start_pfn, end_pfn,
nr_nodemap_entries, MAX_ACTIVE_REGIONS);
@@ -3933,7 +3933,7 @@ void __init free_area_init_nodes(unsigne
for (i = 0; i < MAX_NR_ZONES; i++) {
if (i == ZONE_MOVABLE)
continue;
- printk(" %-8s %8lu -> %8lu\n",
+ printk(" %-8s 0x%8lx -> 0x%8lx\n",
zone_names[i],
arch_zone_lowest_possible_pfn[i],
arch_zone_highest_possible_pfn[i]);
@@ -3949,7 +3949,7 @@ void __init free_area_init_nodes(unsigne
/* Print out the early_node_map[] */
printk("early_node_map[%d] active PFN ranges\n", nr_nodemap_entries);
for (i = 0; i < nr_nodemap_entries; i++)
- printk(" %3d: %8lu -> %8lu\n", early_node_map[i].nid,
+ printk(" %3d: 0x%8lx -> 0x%8lx\n", early_node_map[i].nid,
early_node_map[i].start_pfn,
early_node_map[i].end_pfn);
--- linux-next.orig/arch/x86/mm/init_64.c 2008-06-22 06:35:50.326914251 -0700
+++ linux-next/arch/x86/mm/init_64.c 2008-06-22 06:36:16.812520369 -0700
@@ -830,7 +830,7 @@ int __init reserve_bootmem_generic(unsig
if (pfn < max_pfn_mapped)
return -EFAULT;
- printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %u\n",
+ printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %lu\n",
phys, len);
return -EFAULT;
}
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2008-06-30 7:58 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-25 8:56 [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks Marco Cesati
-- strict thread matches above, loose matches on Subject: below --
2008-06-22 14:21 [PATCH 0/5 v2] x86 boot: various E820 & EFI related fixes - what changed in v2 Paul Jackson
2008-06-22 14:22 ` [PATCH 4/5 v2] x86 boot: show pfn addresses in hex not decimal in some kernel info printks Paul Jackson
2008-06-22 19:38 ` Yinghai Lu
2008-06-23 11:09 ` Paul Jackson
2008-06-24 21:29 ` Yinghai Lu
2008-06-25 1:32 ` Paul Jackson
2008-06-25 1:56 ` H. Peter Anvin
2008-06-25 2:17 ` Paul Jackson
2008-06-25 2:18 ` H. Peter Anvin
2008-06-25 2:58 ` Linus Torvalds
2008-06-25 3:00 ` Linus Torvalds
2008-06-25 3:08 ` Paul Jackson
2008-06-25 4:04 ` Linus Torvalds
2008-06-25 5:01 ` H. Peter Anvin
2008-06-25 14:42 ` Linus Torvalds
2008-06-25 15:29 ` H. Peter Anvin
2008-06-25 8:04 ` Paul Jackson
2008-06-25 14:53 ` Ingo Molnar
2008-06-26 19:14 ` Sam Ravnborg
2008-06-27 12:00 ` Ingo Molnar
2008-06-27 21:25 ` Sam Ravnborg
2008-06-25 15:00 ` Johannes Berg
2008-06-25 15:19 ` Linus Torvalds
2008-06-25 15:34 ` Johannes Berg
2008-06-27 20:43 ` Denys Vlasenko
2008-06-30 7:58 ` Alexander van Heukelum
2008-06-25 5:05 ` H. Peter Anvin
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®