* [PATCH] dm-core-add-ratelimit-printing.patch
@ 2007-04-05 16:36 Jonathan Brassow
2007-04-05 16:59 ` Bryn M. Reeves
2007-04-09 17:23 ` Olaf Kirch
0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Brassow @ 2007-04-05 16:36 UTC (permalink / raw)
To: dm-devel
This patch adds macros for ratelimiting messages.
brassow
Index: linux-2.6.19-rc4-mm2/drivers/md/dm.h
===================================================================
--- linux-2.6.19-rc4-mm2.orig/drivers/md/dm.h 2006-11-07 09:22:45.000000000 -0600
+++ linux-2.6.19-rc4-mm2/drivers/md/dm.h 2006-11-27 15:08:38.000000000 -0600
@@ -19,8 +19,17 @@
#define DM_NAME "device-mapper"
#define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+#define DMERR_LIMIT(f, arg...) \
+ if (printk_ratelimit()) \
+ printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
#define DMWARN(f, arg...) printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+#define DMWARN_LIMIT(f, arg...) \
+ if (printk_ratelimit()) \
+ printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
#define DMINFO(f, arg...) printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+#define DMINFO_LIMIT(f, arg...) \
+ if (printk_ratelimit()) \
+ printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
#ifdef CONFIG_DM_DEBUG
# define DMDEBUG(f, arg...) printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
#else
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dm-core-add-ratelimit-printing.patch
2007-04-05 16:36 [PATCH] dm-core-add-ratelimit-printing.patch Jonathan Brassow
@ 2007-04-05 16:59 ` Bryn M. Reeves
2007-04-09 17:23 ` Olaf Kirch
1 sibling, 0 replies; 4+ messages in thread
From: Bryn M. Reeves @ 2007-04-05 16:59 UTC (permalink / raw)
To: device-mapper development
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jonathan Brassow wrote:
> #define DMINFO(f, arg...) printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
> +#define DMINFO_LIMIT(f, arg...) \
> + if (printk_ratelimit()) \
> + printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
> #ifdef CONFIG_DM_DEBUG
> # define DMDEBUG(f, arg...) printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
> #else
>
Cool! Can we get one for DMDEBUG too? There are some uses of DMDEBUG
messages where it'd be really nice to have a rate limited version of the
macro.
Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFGFSsF6YSQoMYUY94RAouZAJ9kuBSCfJalAnION286Ne/7hrOU7QCgnWJV
Awno4+Q38pWdPH3/d7oaNrk=
=L2hN
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dm-core-add-ratelimit-printing.patch
2007-04-05 16:36 [PATCH] dm-core-add-ratelimit-printing.patch Jonathan Brassow
2007-04-05 16:59 ` Bryn M. Reeves
@ 2007-04-09 17:23 ` Olaf Kirch
2007-04-10 5:17 ` Jonathan Brassow
1 sibling, 1 reply; 4+ messages in thread
From: Olaf Kirch @ 2007-04-09 17:23 UTC (permalink / raw)
To: dm-devel
On Thursday 05 April 2007 18:36, Jonathan Brassow wrote:
> #define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
> +#define DMERR_LIMIT(f, arg...) \
> + if (printk_ratelimit()) \
> + printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
I would put a "do { ... } while (0)" around this, else you end up with nasty surprises
if it's used as in "if (..) DMERR_LIMIT(..) else do_something"
Olaf
--
Olaf Kirch | --- o --- Nous sommes du soleil we love when we play
okir@lst.de | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] dm-core-add-ratelimit-printing.patch
2007-04-09 17:23 ` Olaf Kirch
@ 2007-04-10 5:17 ` Jonathan Brassow
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Brassow @ 2007-04-10 5:17 UTC (permalink / raw)
To: device-mapper development
hmmm, yes. that was stupid.
brassow
On Apr 9, 2007, at 12:23 PM, Olaf Kirch wrote:
> On Thursday 05 April 2007 18:36, Jonathan Brassow wrote:
>> #define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": "
>> DM_MSG_PREFIX ": " f "\n", ## arg)
>> +#define DMERR_LIMIT(f, arg...) \
>> + if (printk_ratelimit()) \
>> + printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
>
> I would put a "do { ... } while (0)" around this, else you end up
> with nasty surprises
> if it's used as in "if (..) DMERR_LIMIT(..) else do_something"
>
> Olaf
> --
> Olaf Kirch | --- o --- Nous sommes du soleil we love when we play
> okir@lst.de | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-04-10 5:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 16:36 [PATCH] dm-core-add-ratelimit-printing.patch Jonathan Brassow
2007-04-05 16:59 ` Bryn M. Reeves
2007-04-09 17:23 ` Olaf Kirch
2007-04-10 5:17 ` Jonathan Brassow
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.