summary refs log tree commit diff
path: root/lib/Kconfig.debug
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2022-09-04 15:40:45 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-07 16:58:23 +0200
commit683263a5e075aca81915a5abc0006a5435d3d54d (patch)
tree247df622efd57da766f2b8c7ee1a151011007538 /lib/Kconfig.debug
parente75ef56f74965f426dd819a41336b640ffdd8fbc (diff)
downloadlinux-683263a5e075aca81915a5abc0006a5435d3d54d.tar.gz
dyndbg: add test_dynamic_debug module
Provide a simple module to allow testing DYNAMIC_DEBUG behavior.  It
calls do_prints() from module-init, and with a sysfs-node.

  dmesg -C
  dmesg -w &
  modprobe test_dynamic_debug dyndbg=+p
  echo 1 > /sys/module/dynamic_debug/parameters/verbose

  cat /sys/module/test_dynamic_debug/parameters/do_prints
  echo module test_dynamic_debug +mftl > /proc/dynamic_debug/control
  echo junk > /sys/module/test_dynamic_debug/parameters/do_prints

Acked-by: Jason Baron <jbaron@akamai.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20220904214134.408619-9-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r--lib/Kconfig.debug10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 072e4b289c13..43b49642cb08 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2546,6 +2546,16 @@ config TEST_STATIC_KEYS
 
 	  If unsure, say N.
 
+config TEST_DYNAMIC_DEBUG
+	tristate "Test DYNAMIC_DEBUG"
+	depends on DYNAMIC_DEBUG
+	help
+	  This module registers a tracer callback to count enabled
+	  pr_debugs in a 'do_debugging' function, then alters their
+	  enablements, calls the function, and compares counts.
+
+	  If unsure, say N.
+
 config TEST_KMOD
 	tristate "kmod stress tester"
 	depends on m