All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: jbaron@akamai.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org
Cc: linux@rasmusvillemoes.dk, Jim Cromie <jim.cromie@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	"David S. Miller" <davem@davemloft.net>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Kent Overstreet <kent.overstreet@gmail.com>,
	"Uladzislau Rezki (Sony)" <urezki@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Gary Hook <Gary.Hook@amd.com>, Arnd Bergmann <arnd@arndb.de>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-doc@vger.kernel.org
Subject: [PATCH 17/18] dyndbg: rename dynamic_debug to dyndbg
Date: Thu,  5 Dec 2019 14:51:50 -0700	[thread overview]
Message-ID: <20191205215151.421926-20-jim.cromie@gmail.com> (raw)
In-Reply-To: <20191205215151.421926-1-jim.cromie@gmail.com>

This rename fixes a subtle usage wrinkle; the __setup() names didn't
match the fake "dyndbg" module parameter used to enable dynamic-printk
callsites in modules.  See the last change in Docs for the effect.

It also shortens the "__FILE__:__func__" prefix in dyndbg.verbose
messages, effectively s/dynamic_debug/dyndbg/

This is a 99.9% rename; trim_prefix and debugfs_create_dir arg excepted.
Nonetheless, it also changes both /sys appearances:

bash-5.0# ls -R /sys/kernel/debug/dyndbg/ /sys/module/dyndbg/parameters/
/sys/kernel/debug/dyndbg/:
control
/sys/module/dyndbg/parameters/:
verbose

Finally, paths in docs are ~= s|/dynamic_debug/|/dyndbg/|,
plus the kernel cmdline example tweak cited above.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 .../admin-guide/dynamic-debug-howto.rst       | 50 +++++++++----------
 lib/Makefile                                  |  4 +-
 lib/{dynamic_debug.c => dyndbg.c}             |  4 +-
 3 files changed, 29 insertions(+), 29 deletions(-)
 rename lib/{dynamic_debug.c => dyndbg.c} (99%)

diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst
index 5c170e49121d..d91dbb52721d 100644
--- a/Documentation/admin-guide/dynamic-debug-howto.rst
+++ b/Documentation/admin-guide/dynamic-debug-howto.rst
@@ -31,7 +31,7 @@ Dynamic debug has even more useful features:
    - module name
    - format string
 
- * Provides a debugfs control file: ``<debugfs>/dynamic_debug/control``
+ * Provides a debugfs control file: ``<debugfs>/dyndbg/control``
    which can be read to display the complete list of known debug
    statements, to help guide you
 
@@ -42,16 +42,16 @@ The behaviour of ``pr_debug()``/``dev_dbg()`` are controlled via writing to a
 control file in the 'debugfs' filesystem. Thus, you must first mount
 the debugfs filesystem, in order to make use of this feature.
 Subsequently, we refer to the control file as:
-``<debugfs>/dynamic_debug/control``. For example, if you want to enable
+``<debugfs>/dyndbg/control``. For example, if you want to enable
 printing from source file ``svcsock.c``, line 1603 you simply do::
 
   nullarbor:~ # echo 'file svcsock.c line 1603 +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
 If you make a mistake with the syntax, the write will fail thus::
 
   nullarbor:~ # echo 'file svcsock.c wtf 1 +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
   -bash: echo: write error: Invalid argument
 
 Viewing Dynamic Debug Behaviour
@@ -60,7 +60,7 @@ Viewing Dynamic Debug Behaviour
 You can view the currently configured behaviour of all the debug
 statements via::
 
-  nullarbor:~ # cat <debugfs>/dynamic_debug/control
+  nullarbor:~ # cat <debugfs>/dyndbg/control
   # filename:lineno [module]function flags format
   net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup =_ "SVCRDMA Module Removed, deregister RPC RDMA transport\012"
   net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init =_ "\011max_inline       : %d\012"
@@ -72,10 +72,10 @@ statements via::
 You can also apply standard Unix text manipulation filters to this
 data, e.g.::
 
-  nullarbor:~ # grep -i rdma <debugfs>/dynamic_debug/control  | wc -l
+  nullarbor:~ # grep -i rdma <debugfs>/dyndbg/control  | wc -l
   62
 
-  nullarbor:~ # grep -i tcp <debugfs>/dynamic_debug/control | wc -l
+  nullarbor:~ # grep -i tcp <debugfs>/dyndbg/control | wc -l
   42
 
 The third column shows the currently enabled flags for each debug
@@ -83,7 +83,7 @@ statement callsite (see below for definitions of the flags).  The
 default value, with no flags enabled, is ``=_``.  So you can view all
 the debug statement callsites with any non-default flags::
 
-  nullarbor:~ # awk '$3 != "=_"' <debugfs>/dynamic_debug/control
+  nullarbor:~ # awk '$3 != "=_"' <debugfs>/dyndbg/control
   # filename:lineno [module]function flags format
   net/sunrpc/svcsock.c:1603 [sunrpc]svc_send p "svc_process: st_sendto returned %d\012"
 
@@ -94,27 +94,27 @@ At the lexical level, a command comprises a sequence of words separated
 by spaces or tabs.  So these are all equivalent::
 
   nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
   nullarbor:~ # echo -n '  file   svcsock.c     line  1603 +p  ' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
   nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
 Command submissions are bounded by a write() system call.
 Multiple commands can be written together, separated by ``;`` or ``\n``::
 
   ~# echo "func pnpacpi_get_resources +p; func pnp_assign_mem +p" \
-     > <debugfs>/dynamic_debug/control
+     > <debugfs>/dyndbg/control
 
 If your query set is big, you can batch them too::
 
-  ~# cat query-batch-file > <debugfs>/dynamic_debug/control
+  ~# cat query-batch-file > <debugfs>/dyndbg/control
 
 Another way is to use wildcards. The match rule supports ``*`` (matches
 zero or more characters) and ``?`` (matches exactly one character). For
 example, you can match all usb drivers::
 
-  ~# echo "file drivers/usb/* +p" > <debugfs>/dynamic_debug/control
+  ~# echo "file drivers/usb/* +p" > <debugfs>/dyndbg/control
 
 At the syntactical level, a command comprises a sequence of match
 specifications, followed by a flags change specification::
@@ -338,7 +338,7 @@ For ``CONFIG_DYNAMIC_DEBUG`` kernels, any settings given at boot-time (or
 enabled by ``-DDEBUG`` flag during compilation) can be disabled later via
 the debugfs interface if the debug messages are no longer needed::
 
-   echo "module module_name -p" > <debugfs>/dynamic_debug/control
+   echo "module module_name -p" > <debugfs>/dyndbg/control
 
 Examples
 ========
@@ -347,41 +347,41 @@ Examples
 
   // enable the message at line 1603 of file svcsock.c
   nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
   // enable all the messages in file svcsock.c
   nullarbor:~ # echo -n 'file svcsock.c +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
   // enable all the messages in the NFS server module
   nullarbor:~ # echo -n 'module nfsd +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
   // enable all 12 messages in the function svc_process()
   nullarbor:~ # echo -n 'func svc_process +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
   // disable all 12 messages in the function svc_process()
   nullarbor:~ # echo -n 'func svc_process -p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
   // enable messages for NFS calls READ, READLINK, READDIR and READDIR+.
   nullarbor:~ # echo -n 'format "nfsd: READ" +p' >
-				<debugfs>/dynamic_debug/control
+				<debugfs>/dyndbg/control
 
   // enable messages in files of which the paths include string "usb"
-  nullarbor:~ # echo -n '*usb* +p' > <debugfs>/dynamic_debug/control
+  nullarbor:~ # echo -n '*usb* +p' > <debugfs>/dyndbg/control
 
   // enable all messages
-  nullarbor:~ # echo -n '+p' > <debugfs>/dynamic_debug/control
+  nullarbor:~ # echo -n '+p' > <debugfs>/dyndbg/control
 
   // add module, function to all enabled messages
-  nullarbor:~ # echo -n '+mf' > <debugfs>/dynamic_debug/control
+  nullarbor:~ # echo -n '+mf' > <debugfs>/dyndbg/control
 
   // boot-args example, with newlines and comments for readability
   Kernel command line: ...
     // see whats going on in dyndbg=value processing
-    dynamic_debug.verbose=1
+    dyndbg.verbose=1
     // enable pr_debugs in 2 builtins, #cmt is stripped
     dyndbg="module params +p #cmt ; module sys +p"
     // enable pr_debugs in 2 functions in a module loaded later
diff --git a/lib/Makefile b/lib/Makefile
index c5892807e06f..ea4028aa7852 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -15,7 +15,7 @@ KCOV_INSTRUMENT_string.o := n
 KCOV_INSTRUMENT_rbtree.o := n
 KCOV_INSTRUMENT_list_debug.o := n
 KCOV_INSTRUMENT_debugobjects.o := n
-KCOV_INSTRUMENT_dynamic_debug.o := n
+KCOV_INSTRUMENT_dyndbg.o := n
 
 # Early boot use of cmdline, don't instrument it
 ifdef CONFIG_AMD_MEM_ENCRYPT
@@ -180,7 +180,7 @@ lib-$(CONFIG_GENERIC_BUG) += bug.o
 
 obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o
 
-obj-$(CONFIG_DYNAMIC_DEBUG) += dynamic_debug.o
+obj-$(CONFIG_DYNAMIC_DEBUG) += dyndbg.o
 
 obj-$(CONFIG_NLATTR) += nlattr.o
 
diff --git a/lib/dynamic_debug.c b/lib/dyndbg.c
similarity index 99%
rename from lib/dynamic_debug.c
rename to lib/dyndbg.c
index d056fca96b9d..f410d341841a 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dyndbg.c
@@ -77,7 +77,7 @@ module_param(verbose, int, 0644);
 /* Return the path relative to source root */
 static inline const char *trim_prefix(const char *path)
 {
-	int skip = strlen(__FILE__) - strlen("lib/dynamic_debug.c");
+	int skip = strlen(__FILE__) - strlen("lib/dyndbg.c");
 
 	if (strncmp(path, __FILE__, skip))
 		skip = 0; /* prefix mismatch, don't skip */
@@ -1055,7 +1055,7 @@ static int __init dynamic_debug_init_debugfs(void)
 	if (!ddebug_init_success)
 		return -ENODEV;
 
-	dir = debugfs_create_dir("dynamic_debug", NULL);
+	dir = debugfs_create_dir("dyndbg", NULL);
 	debugfs_create_file("control", 0644, dir, NULL, &ddebug_proc_fops);
 
 	return 0;
-- 
2.23.0


  parent reply	other threads:[~2019-12-05 21:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 21:51 [PATCH v3 00/18] dynamic-debug cleanups, 2 new features Jim Cromie
2019-12-05 21:51 ` [PATCH 01/18] dyndbg-docs: eschew file /full/path query in docs Jim Cromie
2019-12-05 21:51 ` [PATCH 02/18] dyndbg: drop obsolete comment on ddebug_proc_open Jim Cromie
2019-12-05 21:51 ` [PATCH 03/18] dyndbg: raise verbosity needed to enable ddebug_proc_* logging Jim Cromie
2019-12-05 21:51 ` [PATCH 04/18] dyndbg: rename __verbose section to __dyndbg Jim Cromie
2019-12-05 21:51 ` [PATCH 05/18] dyndbg: fix overcounting of ram used by dyndbg Jim Cromie
2019-12-05 21:51 ` [PATCH 06/18] dyndbg: fix a BUG_ON in ddebug_describe_flags Jim Cromie
2019-12-05 21:51 ` [PATCH 07/18] dyndbg: refactor parse_linerange out of ddebug_parse_query Jim Cromie
2019-12-05 21:51 ` [PATCH 08/18] dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100' Jim Cromie
2019-12-05 21:51 ` [PATCH 09/18] dyndbg: refactor ddebug_read_flags out of ddebug_parse_flags Jim Cromie
2019-12-05 21:51 ` [PATCH 10/18] dyndbg: combine flags & mask into a struct, use that Jim Cromie
2019-12-05 21:51 ` [PATCH 11/18] dyndbg: add filter parameter to ddebug_parse_flags Jim Cromie
2019-12-05 21:51 ` [PATCH 12/18] dyndbg: extend ddebug_parse_flags to accept optional filter-flags Jim Cromie
2019-12-05 21:51 ` [PATCH 13/18] dyndbg: prefer declarative init in caller, to memset in callee Jim Cromie
2019-12-05 21:51 ` [PATCH 14/16] dyndbg: add inverted-flags, implement filtering on flags Jim Cromie
2019-12-05 21:51 ` [PATCH 14/18] dyndbg: add user-flag, negating-flags, and " Jim Cromie
2019-12-05 21:51 ` [PATCH 15/16] dyndbg: allow inverted-flag-chars in modflags Jim Cromie
2019-12-05 21:51 ` [PATCH 15/18] dyndbg: allow negating flag-chars " Jim Cromie
2019-12-05 21:51 ` [PATCH 16/18] dyndbg: make ddebug_tables list LIFO for add/remove_module Jim Cromie
2019-12-05 21:51 ` Jim Cromie [this message]
2019-12-05 22:24   ` [PATCH 17/18] dyndbg: rename dynamic_debug to dyndbg Andy Shevchenko
2019-12-06  7:49     ` Rasmus Villemoes
2019-12-06 17:33       ` jim.cromie
2019-12-05 21:51 ` [PATCH 18/18] dyndbg-docs: normalize comments in examples Jim Cromie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205215151.421926-20-jim.cromie@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=Gary.Hook@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbaron@akamai.com \
    --cc=joe.lawrence@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mark.rutland@arm.com \
    --cc=urezki@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.