* [PATCH RESEND] printk: add pr_devel_once and pr_devel_ratelimited
@ 2013-02-13 14:26 Mikhail Gruzdev
2013-02-13 18:26 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Mikhail Gruzdev @ 2013-02-13 14:26 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikhail Gruzdev, Andrew Morton, Greg Kroah-Hartman
Standardize pr_devel logging macros family by adding pr_devel_once and
pr_devel_ratelimited.
Signed-off-by: Mikhail Gruzdev <michail.gruzdev@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/printk.h | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 9afc01e..f282149 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -255,6 +255,15 @@ extern void dump_stack(void) __cold;
printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont_once(fmt, ...) \
printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
+
+#if defined(DEBUG)
+#define pr_devel_once(fmt, ...) \
+ printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_devel_once(fmt, ...) \
+ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
/* If you are writing a driver, please use dev_dbg instead */
#if defined(DEBUG)
#define pr_debug_once(fmt, ...) \
@@ -298,6 +307,15 @@ extern void dump_stack(void) __cold;
#define pr_info_ratelimited(fmt, ...) \
printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
/* no pr_cont_ratelimited, don't do that... */
+
+#if defined(DEBUG)
+#define pr_devel_ratelimited(fmt, ...) \
+ printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_devel_ratelimited(fmt, ...) \
+ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
/* If you are writing a driver, please use dev_dbg instead */
#if defined(DEBUG)
#define pr_debug_ratelimited(fmt, ...) \
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] printk: add pr_devel_once and pr_devel_ratelimited
2013-02-13 14:26 [PATCH RESEND] printk: add pr_devel_once and pr_devel_ratelimited Mikhail Gruzdev
@ 2013-02-13 18:26 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2013-02-13 18:26 UTC (permalink / raw)
To: Mikhail Gruzdev; +Cc: linux-kernel, Andrew Morton
On Wed, Feb 13, 2013 at 06:26:23PM +0400, Mikhail Gruzdev wrote:
> Standardize pr_devel logging macros family by adding pr_devel_once and
> pr_devel_ratelimited.
>
> Signed-off-by: Mikhail Gruzdev <michail.gruzdev@gmail.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-13 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-13 14:26 [PATCH RESEND] printk: add pr_devel_once and pr_devel_ratelimited Mikhail Gruzdev
2013-02-13 18:26 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).