[PATCH] docs: printk-basics: update the pr_debug() kerneldoc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This updates the kerneldoc comment for the pr_debug() macro to describe
the new set of kernel config options it's affected by.

It also simplifies the description of the pr_debug() and pr_devel()
macros in printk-basics.rst, forwarding the reader to the function
reference.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@xxxxxxxxxxxxx>
---
Some background:

The previous patch I sent to add kerneldocs to printk.h:
https://lore.kernel.org/linux-doc/20200420171544.3c443e36@xxxxxxx/

conflicted with this other patch:
https://lkml.org/lkml/2020/4/20/1320

during the manual linux-next merge. Stephen Rothwell fixed the conflict
but the description of what pr_debug() does needed to be updated to
reflect the changes introduced in the patch by Orson Zhai.

Tested on linux-next with make htmldocs and make pdfdocs.

 Documentation/core-api/printk-basics.rst | 4 ++--
 include/linux/printk.h                   | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/core-api/printk-basics.rst b/Documentation/core-api/printk-basics.rst
index 563a9ce5fe1d..84c853e17200 100644
--- a/Documentation/core-api/printk-basics.rst
+++ b/Documentation/core-api/printk-basics.rst
@@ -100,8 +100,8 @@ would prefix every pr_*() message in that file with the module and function name
 that originated the message.
 
 For debugging purposes there are also two conditionally-compiled macros:
-pr_debug() and pr_devel(), which are compiled-out unless ``DEBUG`` (or
-also ``CONFIG_DYNAMIC_DEBUG`` in the case of pr_debug()) is defined.
+pr_debug() and pr_devel(), which are compiled-out depending on the kernel
+configuration options (See the function reference below for more info).
 
 
 Function reference
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 768ac6bc637d..dab23bcbdeb0 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -408,9 +408,10 @@ extern int kptr_restrict;
  * @fmt: format string
  * @...: arguments for the format string
  *
- * This macro expands to dynamic_pr_debug() if CONFIG_DYNAMIC_DEBUG is
- * set. Otherwise, if DEBUG is defined, it's equivalent to a printk with
- * KERN_DEBUG loglevel. If DEBUG is not defined it does nothing.
+ * This macro expands to dynamic_pr_debug() if CONFIG_DYNAMIC_DEBUG is set or if
+ * CONFIG_DYNAMIC_DEBUG_CORE and DYNAMIC_DEBUG_MODULE are both set.  Otherwise,
+ * if DEBUG is defined, it's equivalent to a printk with KERN_DEBUG loglevel.
+ * If none of the above is defined it does nothing.
  *
  * It uses pr_fmt() to generate the format string (dynamic_pr_debug() uses
  * pr_fmt() internally).
-- 
2.18.0




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux