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

From: Ingo Molnar
Date: Wed May 09 2012 - 13:31:14 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Wed, 2012-05-09 at 19:24 +0200, Ingo Molnar wrote:
>
> > 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.
>
> Not quite following, there's nothing fixed width about
> bitmap_scnlistprintf() output.

There's a maximum field length possible, and we should/could use
that as padding.

Say for 8 bits, the worst-case is something like:

1-2,4-5,7-8

right? The max is roughly len*3/2.

I see a problem there: for something larger like 256 it would
lead to quite some padding ...

Well, we could just skip doing width for now - the ability to
easily print bitmaps is very valuable in itself.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/