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

Joe Perches
2011-07-26T02:24:03Z

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