lkml.org 
[lkml]   [2011]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 11/11] dynamic_debug: use a single printk() to emit msgs
From
Date
On Fri, 2011-07-15 at 17:57 +0200, Bart Van Assche wrote:
> On Fri, Jul 15, 2011 at 5:48 PM, Joe Perches <joe@perches.com> wrote:
> > On Fri, 2011-07-15 at 12:05 +0200, Bart Van Assche wrote:
> >> Not that's it important, but this change makes is possible to
> >> eliminate the tid[] and lineno[] arrays again. Has that been
> >> considered ?
> > tid and lineno are decimal. Not using intermediate
> > arrays would require awkward contortions to snprintf
> > them without emitting 0 in the output.
> Sorry, but I do not agree with the above.

Hey Bart.

Then I think you don't understand the goal
of the change.

The goal is to avoid possible interleaving
of multiple printks from different threads.

> The current implementation
> of __dynamic_pr_debug() shows that an implementation without temporary
> arrays does not require any awkward constructs. See e.g.
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=lib/dynamic_debug.c
> for the source code of the current implementation of
> __dynamic_pr_debug().
> This may be subjective, but my opinion is that following that style
> results in shorter and more elegant code than the approach with the
> temporary arrays proposed in patch 11/11.

It requires awkward contortions to emit
a decimal value or "" without multiple
printks or temporaries.

cheers, Joe



\
 
 \ /
  Last update: 2011-07-15 18:11    [W:0.055 / U:1.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site