Re: [PATCH 24/25] dynamic_debug: drop pr_fmt() fromdynamic_pr_debug

From: Joe Perches
Date: Mon Jul 25 2011 - 22:24:06 EST


On Mon, 2011-07-25 at 15:42 -0600, Jim Cromie wrote:
> dynamic_pr_debug can add module, function, file, and line selectively,
> theres no need to also add them via macro. Moreover, adding them
> via the macro, which is useful for pr_info and friends, causes
> pr_debug to double-print those fields added by the flag-settings.
[]
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
[]
> @@ -65,7 +65,7 @@ extern int __dynamic_netdev_dbg(struct _ddebug *descriptor,
> #define dynamic_pr_debug(fmt, ...) do { \
> DYNAMIC_DEBUG_METADATA(fmt); \
> if (unlikely(descriptor.enabled)) \
> - __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__);\
> + __dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__); \

For me, NAK.

I think this isn't a good idea for now.
Maybe in a year or two after all the #define pr_fmt(foo)
are sorted out better.

This is a #define, that is used by all uses of pr_fmt/pr_debug.

This will have problems with uses of pr_fmt that are not
using KBUILD_MODNAME like all uses of:

#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt

and those that use a specific fixed string like:

#define pr_fmt(fmt) "foo: " fmt


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