[dm-devel] [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option
Damien Le Moal
Damien.LeMoal at wdc.com
Thu May 14 07:53:03 UTC 2020
On 2020/05/14 15:09, Hannes Reinecke wrote:
> Switch to use dynamic debug to avoid having recompile the kernel
> just to enable debugging messages.
>
> Signed-off-by: Hannes Reinecke <hare at suse.de>
> ---
> include/linux/device-mapper.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
> index af48d9da3916..4694e1bb4196 100644
> --- a/include/linux/device-mapper.h
> +++ b/include/linux/device-mapper.h
> @@ -557,12 +557,11 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
> #define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__)
> #define DMINFO_LIMIT(fmt, ...) pr_info_ratelimited(DM_FMT(fmt), ##__VA_ARGS__)
>
> +#define DMDEBUG_LIMIT(fmt, ...) pr_debug_ratelimited(DM_FMT(fmt), ##__VA_ARGS__)
Why do you move this one out of the #ifdef CONFIG_DM_DEBUG scope ?
> #ifdef CONFIG_DM_DEBUG
> #define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__)
> -#define DMDEBUG_LIMIT(fmt, ...) pr_debug_ratelimited(DM_FMT(fmt), ##__VA_ARGS__)
> #else
> -#define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
> -#define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
> +#define DMDEBUG(fmt, ...) pr_debug(DM_FMT(fmt), ##__VA_ARGS__)
> #endif
>
> #define DMEMIT(x...) sz += ((sz >= maxlen) ? \
>
--
Damien Le Moal
Western Digital Research
More information about the dm-devel
mailing list