lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1283449109.1797.347.camel@Joe-Laptop>
Date:	Thu, 02 Sep 2010 10:38:28 -0700
From:	Joe Perches <joe@...ches.com>
To:	Eric Dumazet <eric.dumazet@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Changli Gao <xiaosuo@...il.com>,
	David Miller <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	"Pekka Savola (ipv6)" <pekkas@...core.fi>,
	James Morris <jmorris@...ei.org>,
	Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org
Subject: [RFC PATCH] Add pr_dbg and pr_dbg_always (was: Re: [PATCH v2] net:
 arp: code cleanup)

On Thu, 2010-09-02 at 10:27 +0200, Eric Dumazet wrote:
> Le jeudi 02 septembre 2010 à 16:18 +0800, Changli Gao a écrit :
> > Replace printk(KERN_DEBUG...) with pr_debug(...).
> pr_debug() is not an exact replacement of printk(KERN_DEBUG ...)
> With pr_debug(), you need to recompile this file with -DDEBUG or
> CONFIG_DYNAMIC_DEBUG if you want to catch the messages.

That's also the reason I think there should a new
not conditionally compiled away KERN_DEBUG level like

#define pr_somename(fmt, arg) printk(KERN_DEBUG pr_fmt(fmt), ##arg)

where pr_somename is something moderately short like:

pr_debug_always
pr_debug_force
pr_debug_info
pr_dbg_always

pr_dbg wouldn't be good because it uses a similar name to
dev_dbg but not be conditionally compiled away.

I lean to pr_dbg_always.
I think  pr_dbg should be added for symmetry.

Anyone have other suggestions?

Just leave it alone is one, but I think that because there's
a message logging level below KERN_INFO that people find useful,
there should be an unconditional pr_<level> call for it.

So add pr_dbg, pr_dbg_always and pr_dbg_ratelimited to kernel.h.
---
 include/linux/kernel.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2b0a35e..398f8db 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -416,6 +416,8 @@ extern int hex_to_bin(char ch);
         printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_info(fmt, ...) \
         printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_dbg_always(fmt, ...) \
+        printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_cont(fmt, ...) \
 	printk(KERN_CONT fmt, ##__VA_ARGS__)
 
@@ -441,6 +443,8 @@ extern int hex_to_bin(char ch);
 	({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
 #endif
 
+#define pr_dbg pr_debug
+
 /*
  * ratelimited messages with local ratelimit_state,
  * no local ratelimit_state used in the !PRINTK case
@@ -474,6 +478,8 @@ extern int hex_to_bin(char ch);
 	printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_info_ratelimited(fmt, ...) \
 	printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_dbg_ratelimited(fmt, ...) \
+	printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 /* no pr_cont_ratelimited, don't do that... */
 /* If you are writing a driver, please use dev_dbg instead */
 #if defined(DEBUG)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ