[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAO+b5-qA3s92YX2izXzvzt3MOrzRaPcZtDtK0cDte0ZXnRWxhA@mail.gmail.com>
Date: Fri, 15 Jul 2011 12:05:50 +0200
From: Bart Van Assche <bvanassche@....org>
To: Jason Baron <jbaron@...hat.com>
Cc: gregkh@...e.de, joe@...ches.com, jim.cromie@...il.com,
linux-kernel@...r.kernel.org
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@...hat.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists