Re: [PATCH 09/11] dynamic_debug: add_to_pending() saves non-matchingqueries for later.

From: Bart Van Assche
Date: Sun Jul 03 2011 - 04:24:59 EST


On Tue, Jun 28, 2011 at 9:17 PM, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
> On Tue, Jun 28, 2011 at 1:09 AM, Jim Cromie <jim.cromie@xxxxxxxxx> wrote:
>> +static char prbuf_query[300];
>> +
>> +static char *show_ddebug_query(const struct ddebug_query *q)
>> +{
>
>
> this part (the static fixed-length var)
> gives me some heartburn.
>
> I almost went with macros using pr_info to replace the
>  2 show_*_query fns, but a <debugfs/dynamic_debug/pending file
> might want to use show_pending_query
>
> advice ?

How about using kasprintf() inside show_ddebug_query() and let the
show_ddebug_query() free the buffer that has been allocated by
kasprintf() ?

Bart.
--
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/