Re: [RFC][PATCH] printk: Add %pb to print bitmaps

Ingo Molnar
2012-05-09T17:24:11Z

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, 2012-05-09 at 17:41 +0200, Ingo Molnar wrote:
> > * Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > > On Wed, 2012-05-09 at 16:15 +0200, Ingo Molnar wrote:
> > > > > I guess I should use %.*pb and keep the field_width in case someone
> > > > > manages to actually make bitmap_scnlistprintf() conform to it. The
> > > > > precision is unused anyway.
> > > >
> > > > That's a cute trick, and it's intuitive as well.
> > >
> > > kernel/sched/core.c:5570:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat]
> > >
> > > /me curses a bit.. anybody?
> >
> > Yeah, that's a floating point precision thing (or for strings,
> > right-align) - could you use %30pb, etc?
>
> %*pb you mean? Yeah that works, field width is allowed for %p.
> It does mean we cannot ever make bitmaps respect field width
> though.

I don't think that's a significant limitation, because it's
fixed width anyway. So if this works then this would be a pretty
good and simple to use solution.

Thanks,

Ingo