Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)

2008-07-22 Thread Benjamin Herrenschmidt
On Tue, 2008-07-22 at 20:36 +1000, Michael Ellerman wrote: > concordia powerpc(master) $ find arch/powerpc/ ! -name '*32.*' | xargs > grep "%l" | grep -v "%ll" | wc -l > 635 > > > Someone's gonna get a lot of git points for fixing all those. Might > keep > the speeling fix crowd busy for a But

Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)

2008-07-22 Thread Benjamin Herrenschmidt
> > This is (IMO) a desirable change and will prevent a heck of a lot of > goofing around, and will permit a lot of prior goofing around to > be removed. > > But I bet there are lots of instalces of printk("%l", some_u64) down in > arch code where the type of u64 _is_ known which will now spew w

Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)

2008-07-22 Thread Andrew Morton
On Tue, 22 Jul 2008 20:36:35 +1000 Michael Ellerman <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-22 at 03:05 -0700, Andrew Morton wrote: > > On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > > > > [PATCH] Make u64 long long on all architectures > > > > > > It is cur

Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)

2008-07-22 Thread Michael Ellerman
On Tue, 2008-07-22 at 03:05 -0700, Andrew Morton wrote: > On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > > [PATCH] Make u64 long long on all architectures > > > > It is currently awkward to print a u64 type. Some architectures use > > unsigned long while others u

Re: [PATCH] Make u64 long long on all architectures (was: the printk problem)

2008-07-22 Thread Andrew Morton
On Fri, 4 Jul 2008 20:03:51 -0600 Matthew Wilcox <[EMAIL PROTECTED]> wrote: > [PATCH] Make u64 long long on all architectures > > It is currently awkward to print a u64 type. Some architectures use > unsigned long while others use unsigned long long. Since unsigned long > long is 64-bit for all

Re: the printk problem

2008-07-07 Thread Kyle McMartin
On Fri, Jul 04, 2008 at 02:36:21PM -0600, Matthew Wilcox wrote: > It's also true for parisc, fwiw. Added a cc to them. > I posted a patch months ago for kallsyms on parisc, but it looks like nobody ever responded or cared. Nice. ___ Linuxppc-dev mailin

Re: the printk problem

2008-07-06 Thread Stephen Rothwell
On Mon, 07 Jul 2008 13:28:18 +1000 Michael Ellerman <[EMAIL PROTECTED]> wrote: > > Wasn't that already merged via the trivial scheduler fixes tree or > something? ;) Not yet. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgp7ahdw8jTpz.pgp De

Re: the printk problem

2008-07-06 Thread Benjamin Herrenschmidt
On Mon, 2008-07-07 at 13:26 +1000, Stephen Rothwell wrote: > > Did a few tests and it seems to work. I'll stick a patch converting > > powerpc to use %pS for oops display in -next. > > After you post it to linuxppc-dev and get review comments, of > course ... I though I did that already, looks li

Re: the printk problem

2008-07-06 Thread Michael Ellerman
On Mon, 2008-07-07 at 13:26 +1000, Stephen Rothwell wrote: > On Mon, 07 Jul 2008 11:14:36 +1000 Benjamin Herrenschmidt <[EMAIL PROTECTED]> > wrote: > > > > On Fri, 2008-07-04 at 16:25 -0700, Linus Torvalds wrote: > > > > > > On Sat, 5 Jul 2008, Benjamin Herrenschmidt wrote: > > > > > > > > I'll

Re: the printk problem

2008-07-06 Thread Stephen Rothwell
On Mon, 07 Jul 2008 11:14:36 +1000 Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > > On Fri, 2008-07-04 at 16:25 -0700, Linus Torvalds wrote: > > > > On Sat, 5 Jul 2008, Benjamin Herrenschmidt wrote: > > > > > > I'll give it a try using probe_kernel_address() instead on monday. > > > > Her

Re: the printk problem

2008-07-06 Thread Benjamin Herrenschmidt
On Fri, 2008-07-04 at 16:25 -0700, Linus Torvalds wrote: > > On Sat, 5 Jul 2008, Benjamin Herrenschmidt wrote: > > > > I'll give it a try using probe_kernel_address() instead on monday. > > Here's the updated patch which uses probe_kernel_address() instead (and > moves the whole #ifdef mess ou

Re: the printk problem

2008-07-05 Thread Randy Dunlap
On Sun, 6 Jul 2008 03:02:59 +0300 Pekka Enberg wrote: > On Sat, Jul 05, 2008 at 08:41:39PM +0200, Vegard Nossum wrote: > >> Single letters are bad because it hurts readability and limits the > >> usefulness of the extension. > > On Sat, Jul 5, 2008 at 9:52 PM, Matthew Wilcox <[EMAIL PROTECTED]> w

Re: the printk problem

2008-07-05 Thread Ingo Molnar
* Ingo Molnar <[EMAIL PROTECTED]> wrote: > yeah, agreed, combined it's not an x86 topic anymore. > > [ There's some lkml trouble so i've missed the earlier patch. I'm not > sure the email problem is on my side, see how incomplete the > discussion is on lkml.org as well: > > http://lk

Re: the printk problem

2008-07-05 Thread Ingo Molnar
* Linus Torvalds <[EMAIL PROTECTED]> wrote: > On Sun, 6 Jul 2008, Ingo Molnar wrote: > > > > applied (with the commit message below) to tip/x86/debug for v2.6.27 > > merging, thanks Linus. Can i add your SOB too? > > Sure, add my S-O-B. But I hope/assuem that you also added my earlier > patch

Re: the printk problem

2008-07-05 Thread Linus Torvalds
On Sun, 6 Jul 2008, Ingo Molnar wrote: > > applied (with the commit message below) to tip/x86/debug for v2.6.27 > merging, thanks Linus. Can i add your SOB too? Sure, add my S-O-B. But I hope/assuem that you also added my earlier patch that added the support for '%pS' too? I'm not entirely su

Re: the printk problem

2008-07-05 Thread Ingo Molnar
* Linus Torvalds <[EMAIL PROTECTED]> 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

Re: the printk problem

2008-07-05 Thread Pekka Enberg
On Sat, Jul 05, 2008 at 08:41:39PM +0200, Vegard Nossum wrote: >> Single letters are bad because it hurts readability and limits the >> usefulness of the extension. On Sat, Jul 5, 2008 at 9:52 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > I think you need a little warning noise that goes off in

Re: the printk problem

2008-07-05 Thread Arjan van de Ven
Linus Torvalds wrote: On Fri, 4 Jul 2008, Linus Torvalds 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 entr

Re: the printk problem

2008-07-05 Thread Linus Torvalds
On Fri, 4 Jul 2008, Linus Torvalds 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 do

Re: the printk problem

2008-07-05 Thread Matthew Wilcox
On Sat, Jul 05, 2008 at 08:41:39PM +0200, Vegard Nossum wrote: > Single letters are bad because it hurts readability and limits the > usefulness of the extension. I think you need a little warning noise that goes off in your head that means "I might be overdesigning this". Linus' code is elegant

Re: the printk problem

2008-07-05 Thread Linus Torvalds
On Sat, 5 Jul 2008, Jan Engelhardt wrote: > > So, and what do you do when you run out of alphanumeric characters? Did you actually look at my patch? It's not a single alnum character. It's an arbitrary sequence of alnum characters. IOW, my patch allows %p6N or something like that fo

Re: the printk problem

2008-07-05 Thread Vegard Nossum
On Sat, Jul 5, 2008 at 7:56 PM, Linus Torvalds <[EMAIL PROTECTED]> wrote: > On Sat, 5 Jul 2008, Vegard Nossum wrote: >> On Sat, Jul 5, 2008 at 1:33 PM, Jan Engelhardt <[EMAIL PROTECTED]> wrote: >> > How about %p{feature}? > > No. > > I _expressly_ chose '%p[alphanumeric]*' because it's basically >

Re: the printk problem

2008-07-05 Thread Jan Engelhardt
On Saturday 2008-07-05 19:56, Linus Torvalds wrote: >> > >> > How about %p{feature}? > >No. > >I _expressly_ chose '%p[alphanumeric]*' because it's basically >totally insane to have that in a *real* printk() string: the end result >would be totally unreadable. So, and what do you do when you ru

Re: the printk problem

2008-07-05 Thread Linus Torvalds
On Sat, 5 Jul 2008, Vegard Nossum wrote: > On Sat, Jul 5, 2008 at 1:33 PM, Jan Engelhardt <[EMAIL PROTECTED]> wrote: > > > > On Saturday 2008-07-05 00:01, Andrew Morton wrote: > >> > >>We don't know how much interest there would be in churning NIPQUAD from > >>the net guys. Interestingly, there

Re: the printk problem

2008-07-05 Thread Jan Engelhardt
On Saturday 2008-07-05 15:50, Vegard Nossum wrote: > >I think the most elegant solution would be a macro similar to the >initcall macros, that adds the custom extensions to a table which is >defined by a special linker section. This allows complete >decentralization, but I don't think it's possibl

Re: the printk problem

2008-07-05 Thread Vegard Nossum
On Sat, Jul 5, 2008 at 3:24 PM, Jan Engelhardt <[EMAIL PROTECTED]> wrote: > > On Saturday 2008-07-05 14:52, Vegard Nossum wrote: >>> On Saturday 2008-07-05 00:01, Andrew Morton wrote: We don't know how much interest there would be in churning NIPQUAD from the net guys. Interestingly,

Re: the printk problem

2008-07-05 Thread Vegard Nossum
On Sat, Jul 5, 2008 at 1:33 PM, Jan Engelhardt <[EMAIL PROTECTED]> wrote: > > On Saturday 2008-07-05 00:01, Andrew Morton wrote: >> >>We don't know how much interest there would be in churning NIPQUAD from >>the net guys. Interestingly, there's also %C (wint_t) which is a >>32-bit quantity. So we

Re: the printk problem

2008-07-05 Thread Jan Engelhardt
On Saturday 2008-07-05 14:52, Vegard Nossum wrote: >> On Saturday 2008-07-05 00:01, Andrew Morton wrote: >>> >>>We don't know how much interest there would be in churning NIPQUAD from >>>the net guys. Interestingly, there's also %C (wint_t) which is a >>>32-bit quantity. So we could just go and

Re: the printk problem

2008-07-05 Thread Denys Vlasenko
On Saturday 05 July 2008 00:01, Andrew Morton wrote: > > > We also jump through hoops to print things like sector_t and > > > resource_size_t. They always need to be cast to `unsiged long long', > > > which generates additional stack space and text in some setups. > > > > The thing is that GCC ch

Re: the printk problem

2008-07-05 Thread Jan Engelhardt
On Saturday 2008-07-05 00:01, Andrew Morton wrote: > >We don't know how much interest there would be in churning NIPQUAD from >the net guys. Interestingly, there's also %C (wint_t) which is a >32-bit quantity. So we could just go and say "%C prints an ipv4 >address" and be done with it. But the

Re: the printk problem

2008-07-04 Thread Matthew Wilcox
On Fri, Jul 04, 2008 at 03:01:00PM -0700, Andrew Morton wrote: > (heck, let's cc lkml - avoid having to go through all this again) > > It would be excellent if gcc had an extension system so that you could > add new printf control chars and maybe even tell gcc how to check them. > But of course, i

Re: the printk problem

2008-07-04 Thread Linus Torvalds
On Sat, 5 Jul 2008, Benjamin Herrenschmidt wrote: > > I'll give it a try using probe_kernel_address() instead on monday. Here's the updated patch which uses probe_kernel_address() instead (and moves the whole #ifdef mess out of the code that wants it and into a helper function - and maybe we

Re: the printk problem

2008-07-04 Thread Benjamin Herrenschmidt
On Fri, 2008-07-04 at 13:02 -0700, Linus Torvalds wrote: > > That function descriptor indirection is totally untested, and I did it > with a > > pagefault_disable(); > __get_user(..) > pagefault_enable(); > > thing because I thought it would be nice if printk() was alway

Re: the printk problem

2008-07-04 Thread Benjamin Herrenschmidt
> u64 is easy to fix, and I don't know why we haven't. Just make it > unsigned long long on all architectures. Yup. Also, one of the major user of that is to print a struct resource, which everybody does differently, so we may even look at doing a %pR that does the nice start..end [attr].. Ben.

Re: the printk problem

2008-07-04 Thread Andrew Morton
(heck, let's cc lkml - avoid having to go through all this again) On Fri, 4 Jul 2008 14:42:53 -0600 Matthew Wilcox <[EMAIL PROTECTED]> wrote: > On Fri, Jul 04, 2008 at 01:27:16PM -0700, Andrew Morton wrote: > > On Fri, 4 Jul 2008 13:02:05 -0700 (PDT) Linus Torvalds <[EMAIL PROTECTED]> > > wrote

Re: the printk problem

2008-07-04 Thread Matthew Wilcox
On Fri, Jul 04, 2008 at 01:27:16PM -0700, Andrew Morton wrote: > On Fri, 4 Jul 2008 13:02:05 -0700 (PDT) Linus Torvalds <[EMAIL PROTECTED]> > wrote: > > > so I think we could easily just say that we extend %p in various ways: > > > > > > - %pS - print pointer as a symbol > > > > > > and leave t

Re: the printk problem

2008-07-04 Thread Linus Torvalds
On Fri, 4 Jul 2008, Andrew Morton wrote: > > probe_kernel_address() should be usable here. Right you are. > > +static char *string(char *buf, char *end, char *s, int field_width, int > > precision, int flags) > > +{ > > + int len, i; > > + > > + if ((unsigned long)s < PAGE_SIZE) > > +

Re: the printk problem

2008-07-04 Thread Matthew Wilcox
On Fri, Jul 04, 2008 at 01:02:05PM -0700, Linus Torvalds wrote: > On Fri, 4 Jul 2008, Linus Torvalds wrote: > > > > so I think we could easily just say that we extend %p in various ways: > > > > - %pS - print pointer as a symbol > > > > and leave tons of room for future extensions for different

Re: the printk problem

2008-07-04 Thread Andrew Morton
On Fri, 4 Jul 2008 13:02:05 -0700 (PDT) Linus Torvalds <[EMAIL PROTECTED]> wrote: > > > On Fri, 4 Jul 2008, Linus Torvalds wrote: > > > > so I think we could easily just say that we extend %p in various ways: > > > > - %pS - print pointer as a symbol > > > > and leave tons of room for futur

Re: the printk problem

2008-07-04 Thread Linus Torvalds
On Fri, 4 Jul 2008, Linus Torvalds wrote: > > so I think we could easily just say that we extend %p in various ways: > > - %pS - print pointer as a symbol > > and leave tons of room for future extensions for different kinds of > pointers. So here's a totally untested example patch of this,