Messages in this thread |  | | | From | Bart Van Assche <> | | Date | Fri, 15 Jul 2011 12:05:50 +0200 | | Subject | Re: [PATCH 11/11] dynamic_debug: use a single printk() to emit msgs |
| |
On Thu, Jul 14, 2011 at 6:09 PM, Jason Baron <jbaron@redhat.com> wrote: > +static int dynamic_emit_prefix(const struct _ddebug *descriptor, char *buf) > { > char tid[sizeof(int) + sizeof(int)/2 + 4]; > char lineno[sizeof(int) + sizeof(int)/2]; > @@ -442,31 +444,33 @@ static int dynamic_emit_prefix(const struct _ddebug *descriptor) > else > lineno[0] = 0; > > - return printk(KERN_DEBUG "%s%s%s%s%s%s", > - tid, > - (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ? > - descriptor->modname : "", > - (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ? > - ":" : "", > - (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ? > - descriptor->function : "", > - (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ? > - ":" : "", > - lineno); > + return snprintf(buf, PREFIX_SIZE, KERN_DEBUG"%s%s%s%s%s%s", > + tid, > + (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ? > + descriptor->modname : "", > + (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ? > + ":" : "", > + (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ? > + descriptor->function : "", > + (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ? > + ":" : "", lineno); > }
Not that's it important, but this change makes is possible to eliminate the tid[] and lineno[] arrays again. Has that been considered ?
Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |