hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/admin-guide/dynamic-debug-howto.rst
....@@ -13,6 +13,11 @@
1313 ``print_hex_dump_debug()``/``print_hex_dump_bytes()`` calls can be dynamically
1414 enabled per-callsite.
1515
16
+If you do not want to enable dynamic debug globally (i.e. in some embedded
17
+system), you may set ``CONFIG_DYNAMIC_DEBUG_CORE`` as basic support of dynamic
18
+debug and add ``ccflags := -DDYNAMIC_DEBUG_MODULE`` into the Makefile of any
19
+modules which you'd like to dynamically debug later.
20
+
1621 If ``CONFIG_DYNAMIC_DEBUG`` is not set, ``print_hex_dump_debug()`` is just
1722 shortcut for ``print_hex_dump(KERN_DEBUG)``.
1823
....@@ -65,10 +70,10 @@
6570
6671 nullarbor:~ # cat <debugfs>/dynamic_debug/control
6772 # filename:lineno [module]function flags format
68
- /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup =_ "SVCRDMA Module Removed, deregister RPC RDMA transport\012"
69
- /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init =_ "\011max_inline : %d\012"
70
- /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:340 [svcxprt_rdma]svc_rdma_init =_ "\011sq_depth : %d\012"
71
- /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svc_rdma.c:338 [svcxprt_rdma]svc_rdma_init =_ "\011max_requests : %d\012"
73
+ net/sunrpc/svc_rdma.c:323 [svcxprt_rdma]svc_rdma_cleanup =_ "SVCRDMA Module Removed, deregister RPC RDMA transport\012"
74
+ net/sunrpc/svc_rdma.c:341 [svcxprt_rdma]svc_rdma_init =_ "\011max_inline : %d\012"
75
+ net/sunrpc/svc_rdma.c:340 [svcxprt_rdma]svc_rdma_init =_ "\011sq_depth : %d\012"
76
+ net/sunrpc/svc_rdma.c:338 [svcxprt_rdma]svc_rdma_init =_ "\011max_requests : %d\012"
7277 ...
7378
7479
....@@ -88,7 +93,7 @@
8893
8994 nullarbor:~ # awk '$3 != "=_"' <debugfs>/dynamic_debug/control
9095 # filename:lineno [module]function flags format
91
- /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svcsock.c:1603 [sunrpc]svc_send p "svc_process: st_sendto returned %d\012"
96
+ net/sunrpc/svcsock.c:1603 [sunrpc]svc_send p "svc_process: st_sendto returned %d\012"
9297
9398 Command Language Reference
9499 ==========================
....@@ -113,8 +118,8 @@
113118
114119 ~# cat query-batch-file > <debugfs>/dynamic_debug/control
115120
116
-A another way is to use wildcard. The match rule support ``*`` (matches
117
-zero or more characters) and ``?`` (matches exactly one character).For
121
+Another way is to use wildcards. The match rule supports ``*`` (matches
122
+zero or more characters) and ``?`` (matches exactly one character). For
118123 example, you can match all usb drivers::
119124
120125 ~# echo "file drivers/usb/* +p" > <debugfs>/dynamic_debug/control
....@@ -159,15 +164,18 @@
159164 of each callsite. Example::
160165
161166 func svc_tcp_accept
167
+ func *recv* # in rfcomm, bluetooth, ping, tcp
162168
163169 file
164
- The given string is compared against either the full pathname, the
165
- src-root relative pathname, or the basename of the source file of
166
- each callsite. Examples::
170
+ The given string is compared against either the src-root relative
171
+ pathname, or the basename of the source file of each callsite.
172
+ Examples::
167173
168174 file svcsock.c
169
- file kernel/freezer.c
170
- file /usr/src/packages/BUILD/sgi-enhancednfs-1.4/default/net/sunrpc/svcsock.c
175
+ file kernel/freezer.c # ie column 1 of control file
176
+ file drivers/usb/* # all callsites under it
177
+ file inode.c:start_* # parse :tail as a func (above)
178
+ file inode.c:1-100 # parse :tail as a line-range (above)
171179
172180 module
173181 The given string is compared against the module name
....@@ -177,6 +185,7 @@
177185
178186 module sunrpc
179187 module nfsd
188
+ module drm* # both drm, drm_kms_helper
180189
181190 format
182191 The given string is searched for in the dynamic debug format
....@@ -246,8 +255,8 @@
246255 bootloader may impose lower limits.
247256
248257 These ``dyndbg`` params are processed just after the ddebug tables are
249
-processed, as part of the arch_initcall. Thus you can enable debug
250
-messages in all code run after this arch_initcall via this boot
258
+processed, as part of the early_initcall. Thus you can enable debug
259
+messages in all code run after this early_initcall via this boot
251260 parameter.
252261
253262 On an x86 system for example ACPI enablement is a subsys_initcall and::
....@@ -261,7 +270,7 @@
261270
262271 If ``foo`` module is not built-in, ``foo.dyndbg`` will still be processed at
263272 boot time, without effect, but will be reprocessed when module is
264
-loaded later. ``dyndbg_query=`` and bare ``dyndbg=`` are only processed at
273
+loaded later. ``ddebug_query=`` and bare ``dyndbg=`` are only processed at
265274 boot.
266275
267276
....@@ -304,7 +313,7 @@
304313
305314 For ``CONFIG_DYNAMIC_DEBUG`` kernels, any settings given at boot-time (or
306315 enabled by ``-DDEBUG`` flag during compilation) can be disabled later via
307
-the sysfs interface if the debug messages are no longer needed::
316
+the debugfs interface if the debug messages are no longer needed::
308317
309318 echo "module module_name -p" > <debugfs>/dynamic_debug/control
310319