Re: [PATCH 25/26] dynamic_debug: add pr_fmt_dbg() for dynamic_pr_debug

From: Jim Cromie
Date: Tue Sep 27 2011 - 16:37:56 EST


On Thu, Sep 22, 2011 at 2:57 PM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> On Wed, 2011-09-21 at 15:55 -0600, jim.cromie@xxxxxxxxx wrote:
>> dynamic_pr_debug can add module, function, file, and line selectively,
> []
>> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> []
>> +#ifndef pr_fmt_dbg
>> +#define pr_fmt_dbg(fmt) fmt
>> +#endif
> []
>> +#ifndef pr_fmt_dbg
>> +#define pr_fmt_dbg(fmt) pr_fmt(fmt)
>> +#endif
>
> This might better be placed in printk.h just
> once.
>

yes. it seems to work smoothly.
Only minor annoyance is having to put local defns
above the #includes, but thats no different than previously.


> I think pr_fmt_debug is better than pr_fmt_dbg
> because the function/macro is named pr_debug.

Ok. Done.

> Maybe add all the pr_<level> variants too because
> some like to prefix __func__ to pr_err but not pr_info
> etc.
>

Done. Only wrinkle is wrt pr_warning() vs pr_warn()
I added to your suggestion:
+#define pr_fmt_warn pr_fmt_warning

the imperfection is that user has 4 combos of warn/warning
rather than 2 pairs, but the latter seems less defensible.

revised patch forthcoming shortly
seems I havent mastered reply-to with git send-email :-}
--
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/