Re: [PATCH 2/8] security: apparmor: Use a more current logging style

From: Joe Perches
Date: Wed Feb 26 2014 - 09:43:28 EST


On Tue, 2014-02-25 at 23:31 -0800, John Johansen wrote:
> On 02/24/2014 01:59 PM, Joe Perches wrote:
> > Convert printks to pr_<level>.
> > Add pr_fmt.
> > Coalesce formats.
> > Remove embedded prefixes from logging.
> >
>
> you missed one place,

No, not really.

pr_debug differs from printk(KERN_DEBUG in that
pr_debug is only enabled with a #define DEBUG
or CONFIG_DYNAMIC_DEBUG setting.

I did not want to convert any of the printks
with KERN_DEBUG in this pass as that would
change the message logging by requiring
dynamic debugging be included in the CONFIG.

A subsequent pass converting these uses will
be done if or after these initial patches are
applied.

thanks, Joe

> --- a/security/apparmor/include/apparmor.h
> +++ b/security/apparmor/include/apparmor.h
> @@ -50,7 +50,7 @@ extern unsigned int aa_g_path_max;
> #define AA_DEBUG(fmt, args...) \
> do { \
> if (aa_g_debug && printk_ratelimit()) \
> - printk(KERN_DEBUG "AppArmor: " fmt, ##args); \
> + pr_debug(fmt, ##args); \
> } while (0)
>
> #define AA_ERROR(fmt, args...) \
>
> other than that looks good.
>
> > Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> Acked-by: John Johansen <john.johansen@xxxxxxxxxxxxx>


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