* [PATCHv2 0/2] device-mapper: use dynamic debug @ 2020-05-14 6:09 Hannes Reinecke 2020-05-14 6:09 ` [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option Hannes Reinecke 2020-05-14 6:09 ` [PATCH 2/2] dm-zoned: remove spurious newlines from debugging messages Hannes Reinecke 0 siblings, 2 replies; 7+ messages in thread From: Hannes Reinecke @ 2020-05-14 6:09 UTC (permalink / raw) To: Mike Snitzer; +Cc: Damien LeMoal, dm-devel Hi all, here's an updated version of my earlier patch to switch to dynamic debug instead of using a compile-time option. I've modified the initial patch as suggested by Mike, and also fixed up stray newlines which had crept in with some debugging messages in dm-zoned. Hannes Reinecke (2): device-mapper: use dynamic debug instead of compile-time config option dm-zoned: remove spurious newlines from debugging messages drivers/md/dm-zoned-reclaim.c | 4 ++-- drivers/md/dm-zoned-target.c | 4 ++-- include/linux/device-mapper.h | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) -- 2.16.4 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option 2020-05-14 6:09 [PATCHv2 0/2] device-mapper: use dynamic debug Hannes Reinecke @ 2020-05-14 6:09 ` Hannes Reinecke 2020-05-14 7:53 ` Damien Le Moal 2020-05-14 17:15 ` Mike Snitzer 2020-05-14 6:09 ` [PATCH 2/2] dm-zoned: remove spurious newlines from debugging messages Hannes Reinecke 1 sibling, 2 replies; 7+ messages in thread From: Hannes Reinecke @ 2020-05-14 6:09 UTC (permalink / raw) To: Mike Snitzer; +Cc: Damien LeMoal, dm-devel Switch to use dynamic debug to avoid having recompile the kernel just to enable debugging messages. Signed-off-by: Hannes Reinecke <hare@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__) #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) ? \ -- 2.16.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option 2020-05-14 6:09 ` [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option Hannes Reinecke @ 2020-05-14 7:53 ` Damien Le Moal 2020-05-14 16:26 ` Mike Snitzer 2020-05-14 17:15 ` Mike Snitzer 1 sibling, 1 reply; 7+ messages in thread From: Damien Le Moal @ 2020-05-14 7:53 UTC (permalink / raw) To: Hannes Reinecke, Mike Snitzer; +Cc: dm-devel@redhat.com 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@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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option 2020-05-14 7:53 ` Damien Le Moal @ 2020-05-14 16:26 ` Mike Snitzer 0 siblings, 0 replies; 7+ messages in thread From: Mike Snitzer @ 2020-05-14 16:26 UTC (permalink / raw) To: Damien Le Moal; +Cc: dm-devel@redhat.com On Thu, May 14 2020 at 3:53am -0400, Damien Le Moal <Damien.LeMoal@wdc.com> wrote: > 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@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 ? I'd imagine because it already uses dynamic debugging and is useful even if CONFIG_DM_DEBUG isn't set. Makes sense to me. I'll add a note about it in the commit header though. Mike ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option 2020-05-14 6:09 ` [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option Hannes Reinecke 2020-05-14 7:53 ` Damien Le Moal @ 2020-05-14 17:15 ` Mike Snitzer 1 sibling, 0 replies; 7+ messages in thread From: Mike Snitzer @ 2020-05-14 17:15 UTC (permalink / raw) To: Hannes Reinecke; +Cc: Damien LeMoal, dm-devel On Thu, May 14 2020 at 2:09am -0400, Hannes Reinecke <hare@suse.de> wrote: > Switch to use dynamic debug to avoid having recompile the kernel > just to enable debugging messages. > > Signed-off-by: Hannes Reinecke <hare@suse.de> FYI, I decided to always use pr_debug* rather than preserve using printk if CONFIG_DM_DEBUG is enabled. More consistent and less surprising for a developer (to have to reason through how to enable debugging). May cause initial surprise if debugging messages disappear despite CONFIG_DM_DEBUG being enabled... but pretty sure DM developers can cope (and/or help non-developers) as needed. Patches were staged for 5.8, I also added an additional related cleanup: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/log/?h=dm-5.8 Thanks, Mike ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] dm-zoned: remove spurious newlines from debugging messages 2020-05-14 6:09 [PATCHv2 0/2] device-mapper: use dynamic debug Hannes Reinecke 2020-05-14 6:09 ` [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option Hannes Reinecke @ 2020-05-14 6:09 ` Hannes Reinecke 2020-05-14 7:53 ` Damien Le Moal 1 sibling, 1 reply; 7+ messages in thread From: Hannes Reinecke @ 2020-05-14 6:09 UTC (permalink / raw) To: Mike Snitzer; +Cc: Damien LeMoal, dm-devel DMDEBUG will already add a newline to the logging messages, so we shouldn't be adding it to the message itself. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/md/dm-zoned-reclaim.c | 4 ++-- drivers/md/dm-zoned-target.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c index 39ea0d5d4706..4bfa61540b9c 100644 --- a/drivers/md/dm-zoned-reclaim.c +++ b/drivers/md/dm-zoned-reclaim.c @@ -405,7 +405,7 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc) ret = dmz_flush_metadata(zrc->metadata); if (ret) { - DMDEBUG("(%s): Metadata flush for zone %u failed, err %d\n", + DMDEBUG("(%s): Metadata flush for zone %u failed, err %d", dmz_metadata_label(zmd), rzone->id, ret); return ret; } @@ -493,7 +493,7 @@ static void dmz_reclaim_work(struct work_struct *work) ret = dmz_do_reclaim(zrc); if (ret) { - DMDEBUG("(%s): Reclaim error %d\n", + DMDEBUG("(%s): Reclaim error %d", dmz_metadata_label(zmd), ret); if (!dmz_check_dev(zmd)) return; diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index ea43f6892ced..a3d572da70ad 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -515,7 +515,7 @@ static void dmz_flush_work(struct work_struct *work) /* Flush dirty metadata blocks */ ret = dmz_flush_metadata(dmz->metadata); if (ret) - DMDEBUG("(%s): Metadata flush failed, rc=%d\n", + DMDEBUG("(%s): Metadata flush failed, rc=%d", dmz_metadata_label(dmz->metadata), ret); /* Process queued flush requests */ @@ -679,7 +679,7 @@ static int dmz_map(struct dm_target *ti, struct bio *bio) /* Now ready to handle this BIO */ ret = dmz_queue_chunk_work(dmz, bio); if (ret) { - DMDEBUG("(%s): BIO op %d, can't process chunk %llu, err %i\n", + DMDEBUG("(%s): BIO op %d, can't process chunk %llu, err %i", dmz_metadata_label(zmd), bio_op(bio), (u64)dmz_bio_chunk(zmd, bio), ret); -- 2.16.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] dm-zoned: remove spurious newlines from debugging messages 2020-05-14 6:09 ` [PATCH 2/2] dm-zoned: remove spurious newlines from debugging messages Hannes Reinecke @ 2020-05-14 7:53 ` Damien Le Moal 0 siblings, 0 replies; 7+ messages in thread From: Damien Le Moal @ 2020-05-14 7:53 UTC (permalink / raw) To: Hannes Reinecke, Mike Snitzer; +Cc: dm-devel@redhat.com On 2020/05/14 15:09, Hannes Reinecke wrote: > DMDEBUG will already add a newline to the logging messages, so we > shouldn't be adding it to the message itself. > > Signed-off-by: Hannes Reinecke <hare@suse.de> > --- > drivers/md/dm-zoned-reclaim.c | 4 ++-- > drivers/md/dm-zoned-target.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c > index 39ea0d5d4706..4bfa61540b9c 100644 > --- a/drivers/md/dm-zoned-reclaim.c > +++ b/drivers/md/dm-zoned-reclaim.c > @@ -405,7 +405,7 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc) > > ret = dmz_flush_metadata(zrc->metadata); > if (ret) { > - DMDEBUG("(%s): Metadata flush for zone %u failed, err %d\n", > + DMDEBUG("(%s): Metadata flush for zone %u failed, err %d", > dmz_metadata_label(zmd), rzone->id, ret); > return ret; > } > @@ -493,7 +493,7 @@ static void dmz_reclaim_work(struct work_struct *work) > > ret = dmz_do_reclaim(zrc); > if (ret) { > - DMDEBUG("(%s): Reclaim error %d\n", > + DMDEBUG("(%s): Reclaim error %d", > dmz_metadata_label(zmd), ret); > if (!dmz_check_dev(zmd)) > return; > diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c > index ea43f6892ced..a3d572da70ad 100644 > --- a/drivers/md/dm-zoned-target.c > +++ b/drivers/md/dm-zoned-target.c > @@ -515,7 +515,7 @@ static void dmz_flush_work(struct work_struct *work) > /* Flush dirty metadata blocks */ > ret = dmz_flush_metadata(dmz->metadata); > if (ret) > - DMDEBUG("(%s): Metadata flush failed, rc=%d\n", > + DMDEBUG("(%s): Metadata flush failed, rc=%d", > dmz_metadata_label(dmz->metadata), ret); > > /* Process queued flush requests */ > @@ -679,7 +679,7 @@ static int dmz_map(struct dm_target *ti, struct bio *bio) > /* Now ready to handle this BIO */ > ret = dmz_queue_chunk_work(dmz, bio); > if (ret) { > - DMDEBUG("(%s): BIO op %d, can't process chunk %llu, err %i\n", > + DMDEBUG("(%s): BIO op %d, can't process chunk %llu, err %i", > dmz_metadata_label(zmd), > bio_op(bio), (u64)dmz_bio_chunk(zmd, bio), > ret); > Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-05-14 17:15 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-05-14 6:09 [PATCHv2 0/2] device-mapper: use dynamic debug Hannes Reinecke 2020-05-14 6:09 ` [PATCH 1/2] device-mapper: use dynamic debug instead of compile-time config option Hannes Reinecke 2020-05-14 7:53 ` Damien Le Moal 2020-05-14 16:26 ` Mike Snitzer 2020-05-14 17:15 ` Mike Snitzer 2020-05-14 6:09 ` [PATCH 2/2] dm-zoned: remove spurious newlines from debugging messages Hannes Reinecke 2020-05-14 7:53 ` Damien Le Moal
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.