lkml.org 
[lkml]   [2008]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] dynamic debug - core infrastructure
On Fri, Jun 13, 2008 at 03:00:39PM -0400, Jason Baron wrote:
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -595,6 +595,22 @@ extern const char *dev_driver_string(struct device *dev);
> #ifdef DEBUG
> #define dev_dbg(dev, format, arg...) \
> dev_printk(KERN_DEBUG , dev , format , ## arg)
> +#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
> +#define dev_dbg(dev, format, ...) do { \
> + static char mod_name[] \
> + __attribute__((section("__verbose_strings"))) \
> + = KBUILD_MODNAME; \
> + static struct mod_debug foobar \
> + __used \
> + __attribute__((section("__verbose"), aligned(8))) = \
> + { mod_name, mod_name, "0", "0", NULL }; \

Does the compiler merge all of these variables together into one within
the same file?

If not, should we have a new macro, one per file, for this information?

> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -14,6 +14,7 @@
> #include <linux/compiler.h>
> #include <linux/bitops.h>
> #include <linux/log2.h>
> +#include <linux/dynamic_printk.h>
> #include <asm/byteorder.h>
> #include <asm/bug.h>
>
> @@ -288,15 +289,86 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
> #define pr_info(fmt, arg...) \
> printk(KERN_INFO fmt, ##arg)
>
> -#ifdef DEBUG
> -/* If you are writing a driver, please use dev_dbg instead */

Hm, this comment is still correct, please don't delete it :)

Other than those minor nits, and the fact that your patch has a lot of
trailing whitespace, it's looking very good so far.

thanks,

greg k-h


\
 
 \ /
  Last update: 2008-06-18 18:13    [W:0.109 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site