Re: [RFC] Refactor kenter/kleave/kdebug macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2015-05-16 at 20:01 +0300, Leon Romanovsky wrote:
> Dear David,
> 
> During my work on NOMMU system (mm/nommu.c), I saw definition and
> usage of kenter/kleave/kdebug macros. These macros are compiled as
> empty because of "#if 0" construction.
>   45 #if 0
>   46 #define kenter(FMT, ...) \
>   47         printk(KERN_DEBUG "==> %s("FMT")\n", __func__, ##__VA_ARGS__)
>   48 #define kleave(FMT, ...) \
>   49         printk(KERN_DEBUG "<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
>   50 #define kdebug(FMT, ...) \
>   51         printk(KERN_DEBUG "xxx" FMT"yyy\n", ##__VA_ARGS__)
>   52 #else
>   53 #define kenter(FMT, ...) \
>   54         no_printk(KERN_DEBUG "==> %s("FMT")\n", __func__, ##__VA_ARGS__)
>   55 #define kleave(FMT, ...) \
>   56         no_printk(KERN_DEBUG "<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
>   57 #define kdebug(FMT, ...) \
>   58         no_printk(KERN_DEBUG FMT"\n", ##__VA_ARGS__)
>   59 #endif
[]
> My question is how we should handle such duplicated debug print code?
> As possible solutions, I see five options:
> 1. Leave it as is.
> 2. Move it to general include file (for example linux/printk.h) and
> commonize the output to be consistent between different kdebug users.
> 3. Add CONFIG_*_DEBUG definition for every kdebug user.
> 4. Move everything to "#if 0" construction.
> 5. Move everything to "#if defined(__KDEBUG)" construction.

6: delete the macros and uses


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]