Message ID | 4158432939256f1d15c78372cf8a53cc7ddfddcd.1367979526.git.julien.grall@linaro.org |
---|---|
State | Changes Requested, archived |
Headers | show |
On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote: > When debug is enabled in device tree code, some lines > are bigger than 80 characters. > > Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Although if we can also take steps to not let the line length get too long that would be valuable, I can see 80-100 being tolerable but if we are actually seeing lines with 512 characters that is an issue in its own right. I appreciate you've just picked a "big enough" number and we hopefully aren't seeing anything like 512 in practice. > Changes in v2: > - Move buffer to a static variable > --- > xen/arch/arm/early_printk.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c > index bdf4c0e..0f99a43 100644 > --- a/xen/arch/arm/early_printk.c > +++ b/xen/arch/arm/early_printk.c > @@ -29,6 +29,9 @@ void __init early_putch(char c) > *r = c; > } > > +/* Early printk buffer */ > +static char __initdata buf[512]; > + > static void __init early_puts(const char *s) > { > while (*s != '\0') { > @@ -41,8 +44,6 @@ static void __init early_puts(const char *s) > > static void __init early_vprintk(const char *fmt, va_list args) > { > - char buf[80]; > - > vsnprintf(buf, sizeof(buf), fmt, args); > early_puts(buf); > }
On 05/08/2013 02:00 PM, Ian Campbell wrote: > On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote: >> When debug is enabled in device tree code, some lines >> are bigger than 80 characters. >> >> Signed-off-by: Julien Grall <julien.grall@linaro.org> > > Acked-by: Ian Campbell <ian.campbell@citrix.com> > > Although if we can also take steps to not let the line length get too > long that would be valuable, I can see 80-100 being tolerable but if we > are actually seeing lines with 512 characters that is an issue in its > own right. I appreciate you've just picked a "big enough" number and we > hopefully aren't seeing anything like 512 in practice. It seems, the function printk uses a buffer of 10024. It's mainly when device tree prints full path on each node. >> Changes in v2: >> - Move buffer to a static variable >> --- >> xen/arch/arm/early_printk.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c >> index bdf4c0e..0f99a43 100644 >> --- a/xen/arch/arm/early_printk.c >> +++ b/xen/arch/arm/early_printk.c >> @@ -29,6 +29,9 @@ void __init early_putch(char c) >> *r = c; >> } >> >> +/* Early printk buffer */ >> +static char __initdata buf[512]; >> + >> static void __init early_puts(const char *s) >> { >> while (*s != '\0') { >> @@ -41,8 +44,6 @@ static void __init early_puts(const char *s) >> >> static void __init early_vprintk(const char *fmt, va_list args) >> { >> - char buf[80]; >> - >> vsnprintf(buf, sizeof(buf), fmt, args); >> early_puts(buf); >> } > >
On Thu, 2013-05-09 at 15:32 +0100, Julien Grall wrote: > On 05/08/2013 02:00 PM, Ian Campbell wrote: > > > On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote: > >> When debug is enabled in device tree code, some lines > >> are bigger than 80 characters. > >> > >> Signed-off-by: Julien Grall <julien.grall@linaro.org> > > > > Acked-by: Ian Campbell <ian.campbell@citrix.com> > > > > Although if we can also take steps to not let the line length get too > > long that would be valuable, I can see 80-100 being tolerable but if we > > are actually seeing lines with 512 characters that is an issue in its > > own right. I appreciate you've just picked a "big enough" number and we > > hopefully aren't seeing anything like 512 in practice. > > > It seems, the function printk uses a buffer of 10024. I suppose the extra 0 is a typo, but even 1024 seems excessive! > It's mainly when device tree prints full path on each node. OK, lets leave it for now but maybe at some point think about ways of shortening these lines since even if we print them they are going to be wrapped and hard to read. Perhaps indenting children instead of printing the whole path.
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c index bdf4c0e..0f99a43 100644 --- a/xen/arch/arm/early_printk.c +++ b/xen/arch/arm/early_printk.c @@ -29,6 +29,9 @@ void __init early_putch(char c) *r = c; } +/* Early printk buffer */ +static char __initdata buf[512]; + static void __init early_puts(const char *s) { while (*s != '\0') { @@ -41,8 +44,6 @@ static void __init early_puts(const char *s) static void __init early_vprintk(const char *fmt, va_list args) { - char buf[80]; - vsnprintf(buf, sizeof(buf), fmt, args); early_puts(buf); }
When debug is enabled in device tree code, some lines are bigger than 80 characters. Signed-off-by: Julien Grall <julien.grall@linaro.org> Changes in v2: - Move buffer to a static variable --- xen/arch/arm/early_printk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)