2sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget3/translations/zh_CN/admin-guide/dynamic-debug-howtomodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget3/translations/zh_TW/admin-guide/dynamic-debug-howtomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget3/translations/it_IT/admin-guide/dynamic-debug-howtomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget3/translations/ja_JP/admin-guide/dynamic-debug-howtomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget3/translations/ko_KR/admin-guide/dynamic-debug-howtomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget3/translations/sp_SP/admin-guide/dynamic-debug-howtomodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h Dynamic debugh]h Dynamic debug}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhM/var/lib/git/docbuild/linux/Documentation/admin-guide/dynamic-debug-howto.rsthKubh)}(hhh](h)}(h Introductionh]h Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hwDynamic debug allows you to dynamically enable/disable kernel debug-print code to obtain additional kernel information.h]hwDynamic debug allows you to dynamically enable/disable kernel debug-print code to obtain additional kernel information.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hyIf ``/proc/dynamic_debug/control`` exists, your kernel has dynamic debug. You'll need root access (sudo su) to use this.h](hIf }(hhhhhNhNubhliteral)}(h``/proc/dynamic_debug/control``h]h/proc/dynamic_debug/control}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubhY exists, your kernel has dynamic debug. You’ll need root access (sudo su) to use this.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hDynamic debug provides:h]hDynamic debug provides:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hXr* a Catalog of all *prdbgs* in your kernel. ``cat /proc/dynamic_debug/control`` to see them. * a Simple query/command language to alter *prdbgs* by selecting on any combination of 0 or 1 of: - source filename - function name - line number (including ranges of line numbers) - module name - format string - class name (as known/declared by each module) h]h bullet_list)}(hhh](h list_item)}(h[a Catalog of all *prdbgs* in your kernel. ``cat /proc/dynamic_debug/control`` to see them. h]h)}(hZa Catalog of all *prdbgs* in your kernel. ``cat /proc/dynamic_debug/control`` to see them.h](ha Catalog of all }(hjhhhNhNubhemphasis)}(h*prdbgs*h]hprdbgs}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh in your kernel. }(hjhhhNhNubh)}(h#``cat /proc/dynamic_debug/control``h]hcat /proc/dynamic_debug/control}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh to see them.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hXa Simple query/command language to alter *prdbgs* by selecting on any combination of 0 or 1 of: - source filename - function name - line number (including ranges of line numbers) - module name - format string - class name (as known/declared by each module) h](h)}(h_a Simple query/command language to alter *prdbgs* by selecting on any combination of 0 or 1 of:h](h)a Simple query/command language to alter }(hjWhhhNhNubj")}(h*prdbgs*h]hprdbgs}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjWubh. by selecting on any combination of 0 or 1 of:}(hjWhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjSubj)}(hhh](j)}(hsource filenameh]h)}(hj|h]hsource filename}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjzubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(h function nameh]h)}(hjh]h function name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(h.line number (including ranges of line numbers)h]h)}(hjh]h.line number (including ranges of line numbers)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(h module nameh]h)}(hjh]h module name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(h format stringh]h)}(hjh]h format string}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubj)}(h.class name (as known/declared by each module) h]h)}(h-class name (as known/declared by each module)h]h-class name (as known/declared by each module)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjwubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKhjSubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j *uh1jhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhhhKhhhhubh)}(hNOTE: To actually get the debug-print output on the console, you may need to adjust the kernel ``loglevel=``, or use ``ignore_loglevel``. Read about these kernel parameters in Documentation/admin-guide/kernel-parameters.rst.h](h_NOTE: To actually get the debug-print output on the console, you may need to adjust the kernel }(hj hhhNhNubh)}(h ``loglevel=``h]h loglevel=}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh , or use }(hj hhhNhNubh)}(h``ignore_loglevel``h]hignore_loglevel}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhX. Read about these kernel parameters in Documentation/admin-guide/kernel-parameters.rst.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hViewing Dynamic Debug Behaviourh]hViewing Dynamic Debug Behaviour}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZhhhhhK#ubh)}(hHYou can view the currently configured behaviour in the *prdbg* catalog::h](h7You can view the currently configured behaviour in the }(hjkhhhNhNubj")}(h*prdbg*h]hprdbg}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjkubh catalog:}(hjkhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK%hjZhhubh literal_block)}(hX:#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format init/main.c:1179 [main]initcall_blacklist =_ "blacklisting initcall %s\012 init/main.c:1218 [main]initcall_blacklisted =_ "initcall %s blacklisted\012" init/main.c:1424 [main]run_init_process =_ " with arguments:\012" init/main.c:1426 [main]run_init_process =_ " %s\012" init/main.c:1427 [main]run_init_process =_ " with environment:\012" init/main.c:1429 [main]run_init_process =_ " %s\012"h]hX:#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format init/main.c:1179 [main]initcall_blacklist =_ "blacklisting initcall %s\012 init/main.c:1218 [main]initcall_blacklisted =_ "initcall %s blacklisted\012" init/main.c:1424 [main]run_init_process =_ " with arguments:\012" init/main.c:1426 [main]run_init_process =_ " %s\012" init/main.c:1427 [main]run_init_process =_ " with environment:\012" init/main.c:1429 [main]run_init_process =_ " %s\012"}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK'hjZhhubh)}(hThe 3rd space-delimited column shows the current flags, preceded by a ``=`` for easy use with grep/cut. ``=p`` shows enabled callsites.h](hFThe 3rd space-delimited column shows the current flags, preceded by a }(hjhhhNhNubh)}(h``=``h]h=}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh for easy use with grep/cut. }(hjhhhNhNubh)}(h``=p``h]h=p}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh shows enabled callsites.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK0hjZhhubeh}(h]viewing-dynamic-debug-behaviourah ]h"]viewing dynamic debug behaviourah$]h&]uh1hhhhhhhhK#ubh)}(hhh](h)}(h#Controlling dynamic debug Behaviourh]h#Controlling dynamic debug Behaviour}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK4ubh)}(hgThe behaviour of *prdbg* sites are controlled by writing query/commands to the control file. Example::h](hThe behaviour of }(hjhhhNhNubj")}(h*prdbg*h]hprdbg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubhN sites are controlled by writing query/commands to the control file. Example:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK6hjhhubj)}(hX# grease the interface :#> alias ddcmd='echo $* > /proc/dynamic_debug/control' :#> ddcmd '-p; module main func run* +p' :#> grep =p /proc/dynamic_debug/control init/main.c:1424 [main]run_init_process =p " with arguments:\012" init/main.c:1426 [main]run_init_process =p " %s\012" init/main.c:1427 [main]run_init_process =p " with environment:\012" init/main.c:1429 [main]run_init_process =p " %s\012"h]hX# grease the interface :#> alias ddcmd='echo $* > /proc/dynamic_debug/control' :#> ddcmd '-p; module main func run* +p' :#> grep =p /proc/dynamic_debug/control init/main.c:1424 [main]run_init_process =p " with arguments:\012" init/main.c:1426 [main]run_init_process =p " %s\012" init/main.c:1427 [main]run_init_process =p " with environment:\012" init/main.c:1429 [main]run_init_process =p " %s\012"}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhK9hjhhubh)}(h%Error messages go to console/syslog::h]h$Error messages go to console/syslog:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjhhubj)}(hy:#> ddcmd mode foo +p dyndbg: unknown keyword "mode" dyndbg: query parse failed bash: echo: write error: Invalid argumenth]hy:#> ddcmd mode foo +p dyndbg: unknown keyword "mode" dyndbg: query parse failed bash: echo: write error: Invalid argument}hj$sbah}(h]h ]h"]h$]h&]jjuh1jhhhKEhjhhubh)}(hIf debugfs is also enabled and mounted, ``dynamic_debug/control`` is also under the mount-dir, typically ``/sys/kernel/debug/``.h](h(If debugfs is also enabled and mounted, }(hj2hhhNhNubh)}(h``dynamic_debug/control``h]hdynamic_debug/control}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2ubh( is also under the mount-dir, typically }(hj2hhhNhNubh)}(h``/sys/kernel/debug/``h]h/sys/kernel/debug/}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2ubh.}(hj2hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKJhjhhubeh}(h]#controlling-dynamic-debug-behaviourah ]h"]#controlling dynamic debug behaviourah$]h&]uh1hhhhhhhhK4ubh)}(hhh](h)}(hCommand Language Referenceh]hCommand Language Reference}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhjlhhhhhKNubh)}(hxAt the basic lexical level, a command is a sequence of words separated by spaces or tabs. So these are all equivalent::h]hwAt the basic lexical level, a command is a sequence of words separated by spaces or tabs. So these are all equivalent:}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjlhhubj)}(h:#> ddcmd file svcsock.c line 1603 +p :#> ddcmd "file svcsock.c line 1603 +p" :#> ddcmd ' file svcsock.c line 1603 +p 'h]h:#> ddcmd file svcsock.c line 1603 +p :#> ddcmd "file svcsock.c line 1603 +p" :#> ddcmd ' file svcsock.c line 1603 +p '}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKShjlhhubh)}(hCommand submissions are bounded by a write() system call. Multiple commands can be written together, separated by ``;`` or ``\n``::h](hrCommand submissions are bounded by a write() system call. Multiple commands can be written together, separated by }(hjhhhNhNubh)}(h``;``h]h;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh or }(hjhhhNhNubh)}(h``\n``h]h\n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKWhjlhhubj)}(h:#> ddcmd "func pnpacpi_get_resources +p; func pnp_assign_mem +p" :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p EOC :#> cat query-batch-file > /proc/dynamic_debug/controlh]h:#> ddcmd "func pnpacpi_get_resources +p; func pnp_assign_mem +p" :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p EOC :#> cat query-batch-file > /proc/dynamic_debug/control}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKZhjlhhubh)}(hYou can also use wildcards in each query term. The match rule supports ``*`` (matches zero or more characters) and ``?`` (matches exactly one character). For example, you can match all usb drivers::h](hGYou can also use wildcards in each query term. The match rule supports }(hjhhhNhNubh)}(h``*``h]h*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh' (matches zero or more characters) and }(hjhhhNhNubh)}(h``?``h]h?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhM (matches exactly one character). For example, you can match all usb drivers:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKahjlhhubj)}(hF:#> ddcmd file "drivers/usb/*" +p # "" to suppress shell expansionh]hF:#> ddcmd file "drivers/usb/*" +p # "" to suppress shell expansion}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhKehjlhhubh)}(h\Syntactically, a command is pairs of keyword values, followed by a flags change or setting::h]h[Syntactically, a command is pairs of keyword values, followed by a flags change or setting:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjlhhubj)}(h"command ::= match-spec* flags-spech]h"command ::= match-spec* flags-spec}hj'sbah}(h]h ]h"]h$]h&]jjuh1jhhhKjhjlhhubh)}(hThe match-spec's select *prdbgs* from the catalog, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*".h](hThe match-spec’s select }(hj5hhhNhNubj")}(h*prdbgs*h]hprdbgs}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj5ubh from the catalog, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword “*”.}(hj5hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKlhjlhhubh)}(hA match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are:::h]hA match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjlhhubj)}(hXGmatch-spec ::= 'func' string | 'file' string | 'module' string | 'format' string | 'class' string | 'line' line-range line-range ::= lineno | '-'lineno | lineno'-' | lineno'-'lineno lineno ::= unsigned-inth]hXGmatch-spec ::= 'func' string | 'file' string | 'module' string | 'format' string | 'class' string | 'line' line-range line-range ::= lineno | '-'lineno | lineno'-' | lineno'-'lineno lineno ::= unsigned-int}hjcsbah}(h]h ]h"]h$]h&]jjuh1jhhhKuhjlhhubhnote)}(hT``line-range`` cannot contain space, e.g. "1-30" is valid range but "1 - 30" is not.h]h)}(hT``line-range`` cannot contain space, e.g. "1-30" is valid range but "1 - 30" is not.h](h)}(h``line-range``h]h line-range}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjwubhN cannot contain space, e.g. “1-30” is valid range but “1 - 30” is not.}(hjwhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjsubah}(h]h ]h"]h$]h&]uh1jqhjlhhhhhNubh)}(h!The meanings of each keyword are:h]h!The meanings of each keyword are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjlhhubhdefinition_list)}(hhh](hdefinition_list_item)}(hfunc The given string is compared against the function name of each callsite. Example:: func svc_tcp_accept func *recv* # in rfcomm, bluetooth, ping, tcp h](hterm)}(hfunch]hfunc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh](h)}(hSThe given string is compared against the function name of each callsite. Example::h]hRThe given string is compared against the function name of each callsite. Example:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hMfunc svc_tcp_accept func *recv* # in rfcomm, bluetooth, ping, tcph]hMfunc svc_tcp_accept func *recv* # in rfcomm, bluetooth, ping, tcp}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hXfile The given string is compared against either the src-root relative pathname, or the basename of the source file of each callsite. Examples:: file svcsock.c file kernel/freezer.c # ie column 1 of control file file drivers/usb/* # all callsites under it file inode.c:start_* # parse :tail as a func (above) file inode.c:1-100 # parse :tail as a line-range (above) h](j)}(hfileh]hfile}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh](h)}(hThe given string is compared against either the src-root relative pathname, or the basename of the source file of each callsite. Examples::h]hThe given string is compared against either the src-root relative pathname, or the basename of the source file of each callsite. Examples:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hfile svcsock.c file kernel/freezer.c # ie column 1 of control file file drivers/usb/* # all callsites under it file inode.c:start_* # parse :tail as a func (above) file inode.c:1-100 # parse :tail as a line-range (above)h]hfile svcsock.c file kernel/freezer.c # ie column 1 of control file file drivers/usb/* # all callsites under it file inode.c:start_* # parse :tail as a func (above) file inode.c:1-100 # parse :tail as a line-range (above)}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hX3module The given string is compared against the module name of each callsite. The module name is the string as seen in ``lsmod``, i.e. without the directory or the ``.ko`` suffix and with ``-`` changed to ``_``. Examples:: module sunrpc module nfsd module drm* # both drm, drm_kms_helper h](j)}(hmoduleh]hmodule}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj,ubj)}(hhh](h)}(hThe given string is compared against the module name of each callsite. The module name is the string as seen in ``lsmod``, i.e. without the directory or the ``.ko`` suffix and with ``-`` changed to ``_``. Examples::h](hqThe given string is compared against the module name of each callsite. The module name is the string as seen in }(hjAhhhNhNubh)}(h ``lsmod``h]hlsmod}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAubh$, i.e. without the directory or the }(hjAhhhNhNubh)}(h``.ko``h]h.ko}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAubh suffix and with }(hjAhhhNhNubh)}(h``-``h]h-}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAubh changed to }(hjAhhhNhNubh)}(h``_``h]h_}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAubh . Examples:}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj>ubj)}(hDmodule sunrpc module nfsd module drm* # both drm, drm_kms_helperh]hDmodule sunrpc module nfsd module drm* # both drm, drm_kms_helper}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhj>ubeh}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hXformat The given string is searched for in the dynamic debug format string. Note that the string does not need to match the entire format, only some part. Whitespace and other special characters can be escaped using C octal character escape ``\ooo`` notation, e.g. the space character is ``\040``. Alternatively, the string can be enclosed in double quote characters (``"``) or single quote characters (``'``). Examples:: format svcrdma: // many of the NFS/RDMA server pr_debugs format readahead // some pr_debugs in the readahead cache format nfsd:\040SETATTR // one way to match a format with whitespace format "nfsd: SETATTR" // a neater way to match a format with whitespace format 'nfsd: SETATTR' // yet another way to match a format with whitespace h](j)}(hformath]hformat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh](h)}(hXThe given string is searched for in the dynamic debug format string. Note that the string does not need to match the entire format, only some part. Whitespace and other special characters can be escaped using C octal character escape ``\ooo`` notation, e.g. the space character is ``\040``. Alternatively, the string can be enclosed in double quote characters (``"``) or single quote characters (``'``). Examples::h](hThe given string is searched for in the dynamic debug format string. Note that the string does not need to match the entire format, only some part. Whitespace and other special characters can be escaped using C octal character escape }(hjhhhNhNubh)}(h``\ooo``h]h\ooo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh' notation, e.g. the space character is }(hjhhhNhNubh)}(h``\040``h]h\040}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhH. Alternatively, the string can be enclosed in double quote characters (}(hjhhhNhNubh)}(h``"``h]h"}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh) or single quote characters (}(hjhhhNhNubh)}(h``'``h]h'}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh ). Examples:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hX]format svcrdma: // many of the NFS/RDMA server pr_debugs format readahead // some pr_debugs in the readahead cache format nfsd:\040SETATTR // one way to match a format with whitespace format "nfsd: SETATTR" // a neater way to match a format with whitespace format 'nfsd: SETATTR' // yet another way to match a format with whitespaceh]hX]format svcrdma: // many of the NFS/RDMA server pr_debugs format readahead // some pr_debugs in the readahead cache format nfsd:\040SETATTR // one way to match a format with whitespace format "nfsd: SETATTR" // a neater way to match a format with whitespace format 'nfsd: SETATTR' // yet another way to match a format with whitespace}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hXclass The given class_name is validated against each module, which may have declared a list of known class_names. If the class_name is found for a module, callsite & class matching and adjustment proceeds. Examples:: class DRM_UT_KMS # a DRM.debug category class JUNK # silent non-match // class TLD_* # NOTICE: no wildcard in class names h](j)}(hclassh]hclass}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj6ubj)}(hhh](h)}(hThe given class_name is validated against each module, which may have declared a list of known class_names. If the class_name is found for a module, callsite & class matching and adjustment proceeds. Examples::h]hThe given class_name is validated against each module, which may have declared a list of known class_names. If the class_name is found for a module, callsite & class matching and adjustment proceeds. Examples:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjHubj)}(hclass DRM_UT_KMS # a DRM.debug category class JUNK # silent non-match // class TLD_* # NOTICE: no wildcard in class namesh]hclass DRM_UT_KMS # a DRM.debug category class JUNK # silent non-match // class TLD_* # NOTICE: no wildcard in class names}hjYsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjHubeh}(h]h ]h"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hXline The given line number or range of line numbers is compared against the line number of each ``pr_debug()`` callsite. A single line number matches the callsite line number exactly. A range of line numbers matches any callsite between the first and last line number inclusive. An empty first number means the first line in the file, an empty last line number means the last line number in the file. Examples:: line 1603 // exactly line 1603 line 1600-1605 // the six lines from line 1600 to line 1605 line -1605 // the 1605 lines from line 1 to line 1605 line 1600- // all lines from line 1600 to the end of the file h](j)}(hlineh]hline}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjsubj)}(hhh](h)}(hXThe given line number or range of line numbers is compared against the line number of each ``pr_debug()`` callsite. A single line number matches the callsite line number exactly. A range of line numbers matches any callsite between the first and last line number inclusive. An empty first number means the first line in the file, an empty last line number means the last line number in the file. Examples::h](h[The given line number or range of line numbers is compared against the line number of each }(hjhhhNhNubh)}(h``pr_debug()``h]h pr_debug()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhX0 callsite. A single line number matches the callsite line number exactly. A range of line numbers matches any callsite between the first and last line number inclusive. An empty first number means the first line in the file, an empty last line number means the last line number in the file. Examples:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(hline 1603 // exactly line 1603 line 1600-1605 // the six lines from line 1600 to line 1605 line -1605 // the 1605 lines from line 1 to line 1605 line 1600- // all lines from line 1600 to the end of the fileh]hline 1603 // exactly line 1603 line 1600-1605 // the six lines from line 1600 to line 1605 line -1605 // the 1605 lines from line 1 to line 1605 line 1600- // all lines from line 1600 to the end of the file}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h]h ]h"]h$]h&]uh1jhjlhhhhhNubh)}(hThe flags specification comprises a change operation followed by one or more flag characters. The change operation is one of the characters::h]hThe flags specification comprises a change operation followed by one or more flag characters. The change operation is one of the characters:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjlhhubj)}(hZ- remove the given flags + add the given flags = set the flags to the given flagsh]hZ- remove the given flags + add the given flags = set the flags to the given flags}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjlhhubh)}(hThe flags are::h]hThe flags are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjlhhubj)}(hXp enables the pr_debug() callsite. _ enables no flags. Decorator flags add to the message-prefix, in order: t Include thread ID, or m Include module name f Include the function name s Include the source file name l Include line numberh]hXp enables the pr_debug() callsite. _ enables no flags. Decorator flags add to the message-prefix, in order: t Include thread ID, or m Include module name f Include the function name s Include the source file name l Include line number}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjlhhubh)}(hxFor ``print_hex_dump_debug()`` and ``print_hex_dump_bytes()``, only the ``p`` flag has meaning, other flags are ignored.h](hFor }(hjhhhNhNubh)}(h``print_hex_dump_debug()``h]hprint_hex_dump_debug()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``print_hex_dump_bytes()``h]hprint_hex_dump_bytes()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh , only the }(hjhhhNhNubh)}(h``p``h]hp}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh+ flag has meaning, other flags are ignored.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjlhhubh)}(h{Note the regexp ``^[-+=][fslmpt_]+$`` matches a flags specification. To clear all flags at once, use ``=_`` or ``-fslmpt``.h](hNote the regexp }(hjDhhhNhNubh)}(h``^[-+=][fslmpt_]+$``h]h^[-+=][fslmpt_]+$}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjDubh@ matches a flags specification. To clear all flags at once, use }(hjDhhhNhNubh)}(h``=_``h]h=_}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjDubh or }(hjDhhhNhNubh)}(h ``-fslmpt``h]h-fslmpt}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhjDubh.}(hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjlhhubeh}(h]command-language-referenceah ]h"]command language referenceah$]h&]uh1hhhhhhhhKNubh)}(hhh](h)}(h"Debug messages during Boot Processh]h"Debug messages during Boot Process}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX/To activate debug messages for core code and built-in modules during the boot process, even before userspace and debugfs exists, use ``dyndbg="QUERY"`` or ``module.dyndbg="QUERY"``. QUERY follows the syntax described above, but must not exceed 1023 characters. Your bootloader may impose lower limits.h](hTo activate debug messages for core code and built-in modules during the boot process, even before userspace and debugfs exists, use }(hjhhhNhNubh)}(h``dyndbg="QUERY"``h]hdyndbg="QUERY"}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh or }(hjhhhNhNubh)}(h``module.dyndbg="QUERY"``h]hmodule.dyndbg="QUERY"}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh{. QUERY follows the syntax described above, but must not exceed 1023 characters. Your bootloader may impose lower limits.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThese ``dyndbg`` params are processed just after the ddebug tables are processed, as part of the early_initcall. Thus you can enable debug messages in all code run after this early_initcall via this boot parameter.h](hThese }(hjhhhNhNubh)}(h ``dyndbg``h]hdyndbg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh params are processed just after the ddebug tables are processed, as part of the early_initcall. Thus you can enable debug messages in all code run after this early_initcall via this boot parameter.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hGOn an x86 system for example ACPI enablement is a subsys_initcall and::h]hFOn an x86 system for example ACPI enablement is a subsys_initcall and:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hdyndbg="file ec.c +p"h]hdyndbg="file ec.c +p"}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubh)}(hwill show early Embedded Controller transactions during ACPI setup if your machine (typically a laptop) has an Embedded Controller. PCI (or other devices) initialization also is a hot candidate for using this boot parameter for debugging purposes.h]hwill show early Embedded Controller transactions during ACPI setup if your machine (typically a laptop) has an Embedded Controller. PCI (or other devices) initialization also is a hot candidate for using this boot parameter for debugging purposes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIf ``foo`` module is not built-in, ``foo.dyndbg`` will still be processed at boot time, without effect, but will be reprocessed when module is loaded later. Bare ``dyndbg=`` is only processed at boot.h](hIf }(hjhhhNhNubh)}(h``foo``h]hfoo}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh module is not built-in, }(hjhhhNhNubh)}(h``foo.dyndbg``h]h foo.dyndbg}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhq will still be processed at boot time, without effect, but will be reprocessed when module is loaded later. Bare }(hjhhhNhNubh)}(h ``dyndbg=``h]hdyndbg=}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh is only processed at boot.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]"debug-messages-during-boot-processah ]h"]"debug messages during boot processah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h,Debug Messages at Module Initialization Timeh]h,Debug Messages at Module Initialization Time}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihhhhhMubh)}(hWhen ``modprobe foo`` is called, modprobe scans ``/proc/cmdline`` for ``foo.params``, strips ``foo.``, and passes them to the kernel along with params given in modprobe args or ``/etc/modprobe.d/*.conf`` files, in the following order:h](hWhen }(hjzhhhNhNubh)}(h``modprobe foo``h]h modprobe foo}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzubh is called, modprobe scans }(hjzhhhNhNubh)}(h``/proc/cmdline``h]h /proc/cmdline}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzubh for }(hjzhhhNhNubh)}(h``foo.params``h]h foo.params}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzubh , strips }(hjzhhhNhNubh)}(h``foo.``h]hfoo.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzubhL, and passes them to the kernel along with params given in modprobe args or }(hjzhhhNhNubh)}(h``/etc/modprobe.d/*.conf``h]h/etc/modprobe.d/*.conf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzubh files, in the following order:}(hjzhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjihhubhenumerated_list)}(hhh](j)}(hxparameters given via ``/etc/modprobe.d/*.conf``:: options foo dyndbg=+pt options foo dyndbg # defaults to +p h](h)}(h1parameters given via ``/etc/modprobe.d/*.conf``::h](hparameters given via }(hjhhhNhNubh)}(h``/etc/modprobe.d/*.conf``h]h/etc/modprobe.d/*.conf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(h:options foo dyndbg=+pt options foo dyndbg # defaults to +ph]h:options foo dyndbg=+pt options foo dyndbg # defaults to +p}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hv``foo.dyndbg`` as given in boot args, ``foo.`` is stripped and passed:: foo.dyndbg=" func bar +p; func buz +mp" h](h)}(hG``foo.dyndbg`` as given in boot args, ``foo.`` is stripped and passed::h](h)}(h``foo.dyndbg``h]h foo.dyndbg}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj# ubh as given in boot args, }(hj# hhhNhNubh)}(h``foo.``h]hfoo.}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj# ubh is stripped and passed:}(hj# hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(h'foo.dyndbg=" func bar +p; func buz +mp"h]h'foo.dyndbg=" func bar +p; func buz +mp"}hjQ sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hOargs to modprobe:: modprobe foo dyndbg==pmf # override previous settings h](h)}(hargs to modprobe::h]hargs to modprobe:}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhje ubj)}(h5modprobe foo dyndbg==pmf # override previous settingsh]h5modprobe foo dyndbg==pmf # override previous settings}hjw sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhje ubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjihhhhhMubh)}(hThese ``dyndbg`` queries are applied in order, with last having final say. This allows boot args to override or modify those from ``/etc/modprobe.d`` (sensible, since 1 is system wide, 2 is kernel or boot specific), and modprobe args to override both.h](hThese }(hj hhhNhNubh)}(h ``dyndbg``h]hdyndbg}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhr queries are applied in order, with last having final say. This allows boot args to override or modify those from }(hj hhhNhNubh)}(h``/etc/modprobe.d``h]h/etc/modprobe.d}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhf (sensible, since 1 is system wide, 2 is kernel or boot specific), and modprobe args to override both.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjihhubh)}(hIn the ``foo.dyndbg="QUERY"`` form, the query must exclude ``module foo``. ``foo`` is extracted from the param-name, and applied to each query in ``QUERY``, and only 1 match-spec of each type is allowed.h](hIn the }(hj hhhNhNubh)}(h``foo.dyndbg="QUERY"``h]hfoo.dyndbg="QUERY"}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh form, the query must exclude }(hj hhhNhNubh)}(h``module foo``h]h module foo}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh. }(hj hhhNhNubh)}(h``foo``h]hfoo}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh@ is extracted from the param-name, and applied to each query in }(hj hhhNhNubh)}(h ``QUERY``h]hQUERY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh0, and only 1 match-spec of each type is allowed.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjihhubh)}(h@The ``dyndbg`` option is a "fake" module parameter, which means:h](hThe }(hj hhhNhNubh)}(h ``dyndbg``h]hdyndbg}(hj& hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh6 option is a “fake” module parameter, which means:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM$hjihhubj)}(hhh](j)}(h+modules do not need to define it explicitlyh]h)}(hjC h]h+modules do not need to define it explicitly}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjA ubah}(h]h ]h"]h$]h&]uh1jhj> hhhhhNubj)}(h>every module gets it tacitly, whether they use pr_debug or noth]h)}(hjZ h]h>every module gets it tacitly, whether they use pr_debug or not}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjX ubah}(h]h ]h"]h$]h&]uh1jhj> hhhhhNubj)}(hyit doesn't appear in ``/sys/module/$module/parameters/`` To see it, grep the control file, or inspect ``/proc/cmdline.`` h]h)}(hxit doesn't appear in ``/sys/module/$module/parameters/`` To see it, grep the control file, or inspect ``/proc/cmdline.``h](hit doesn’t appear in }(hjs hhhNhNubh)}(h#``/sys/module/$module/parameters/``h]h/sys/module/$module/parameters/}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubh. To see it, grep the control file, or inspect }(hjs hhhNhNubh)}(h``/proc/cmdline.``h]h/proc/cmdline.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubeh}(h]h ]h"]h$]h&]uh1hhhhM(hjo ubah}(h]h ]h"]h$]h&]uh1jhj> hhhhhNubeh}(h]h ]h"]h$]h&]j j uh1jhhhM&hjihhubh)}(hFor ``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::h](hFor }(hj hhhNhNubh)}(h``CONFIG_DYNAMIC_DEBUG``h]hCONFIG_DYNAMIC_DEBUG}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh9 kernels, any settings given at boot-time (or enabled by }(hj hhhNhNubh)}(h ``-DDEBUG``h]h-DDEBUG}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhu flag during compilation) can be disabled later via the debugfs interface if the debug messages are no longer needed:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM+hjihhubj)}(h:echo "module module_name -p" > /proc/dynamic_debug/controlh]h:echo "module module_name -p" > /proc/dynamic_debug/control}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhM/hjihhubeh}(h],debug-messages-at-module-initialization-timeah ]h"],debug messages at module initialization timeah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hExamplesh]hExamples}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM2ubj)}(hX// enable the message at line 1603 of file svcsock.c :#> ddcmd 'file svcsock.c line 1603 +p' // enable all the messages in file svcsock.c :#> ddcmd 'file svcsock.c +p' // enable all the messages in the NFS server module :#> ddcmd 'module nfsd +p' // enable all 12 messages in the function svc_process() :#> ddcmd 'func svc_process +p' // disable all 12 messages in the function svc_process() :#> ddcmd 'func svc_process -p' // enable messages for NFS calls READ, READLINK, READDIR and READDIR+. :#> ddcmd 'format "nfsd: READ" +p' // enable messages in files of which the paths include string "usb" :#> ddcmd 'file *usb* +p' // enable all messages :#> ddcmd '+p' // add module, function to all enabled messages :#> ddcmd '+mf' // boot-args example, with newlines and comments for readability Kernel command line: ... // see what's going on in dyndbg=value processing dynamic_debug.verbose=3 // enable pr_debugs in the btrfs module (can be builtin or loadable) btrfs.dyndbg="+p" // enable pr_debugs in all files under init/ // and the function parse_one, #cmt is stripped dyndbg="file init/* +p #cmt ; func parse_one +p" // enable pr_debugs in 2 functions in a module loaded later pc87360.dyndbg="func pc87360_init_device +p; func pc87360_find +p"h]hX// enable the message at line 1603 of file svcsock.c :#> ddcmd 'file svcsock.c line 1603 +p' // enable all the messages in file svcsock.c :#> ddcmd 'file svcsock.c +p' // enable all the messages in the NFS server module :#> ddcmd 'module nfsd +p' // enable all 12 messages in the function svc_process() :#> ddcmd 'func svc_process +p' // disable all 12 messages in the function svc_process() :#> ddcmd 'func svc_process -p' // enable messages for NFS calls READ, READLINK, READDIR and READDIR+. :#> ddcmd 'format "nfsd: READ" +p' // enable messages in files of which the paths include string "usb" :#> ddcmd 'file *usb* +p' // enable all messages :#> ddcmd '+p' // add module, function to all enabled messages :#> ddcmd '+mf' // boot-args example, with newlines and comments for readability Kernel command line: ... // see what's going on in dyndbg=value processing dynamic_debug.verbose=3 // enable pr_debugs in the btrfs module (can be builtin or loadable) btrfs.dyndbg="+p" // enable pr_debugs in all files under init/ // and the function parse_one, #cmt is stripped dyndbg="file init/* +p #cmt ; func parse_one +p" // enable pr_debugs in 2 functions in a module loaded later pc87360.dyndbg="func pc87360_init_device +p; func pc87360_find +p"}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhM6hj hhubeh}(h]examplesah ]h"]examplesah$]h&]uh1hhhhhhhhM2ubh)}(hhh](h)}(hKernel Configurationh]hKernel Configuration}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM^ubh)}(h2Dynamic Debug is enabled via kernel config items::h]h1Dynamic Debug is enabled via kernel config items:}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hj hhubj)}(hCONFIG_DYNAMIC_DEBUG=y # build catalog, enables CORE CONFIG_DYNAMIC_DEBUG_CORE=y # enable mechanics only, skip catalogh]hCONFIG_DYNAMIC_DEBUG=y # build catalog, enables CORE CONFIG_DYNAMIC_DEBUG_CORE=y # enable mechanics only, skip catalog}hj; sbah}(h]h ]h"]h$]h&]jjuh1jhhhMbhj hhubh)}(hXIf you do not want to enable dynamic debug globally (i.e. in some embedded system), you may set ``CONFIG_DYNAMIC_DEBUG_CORE`` as basic support of dynamic debug and add ``ccflags := -DDYNAMIC_DEBUG_MODULE`` into the Makefile of any modules which you'd like to dynamically debug later.h](h`If you do not want to enable dynamic debug globally (i.e. in some embedded system), you may set }(hjI hhhNhNubh)}(h``CONFIG_DYNAMIC_DEBUG_CORE``h]hCONFIG_DYNAMIC_DEBUG_CORE}(hjQ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjI ubh+ as basic support of dynamic debug and add }(hjI hhhNhNubh)}(h%``ccflags := -DDYNAMIC_DEBUG_MODULE``h]h!ccflags := -DDYNAMIC_DEBUG_MODULE}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjI ubhP into the Makefile of any modules which you’d like to dynamically debug later.}(hjI hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMehj hhubeh}(h]kernel-configurationah ]h"]kernel configurationah$]h&]uh1hhhhhhhhM^ubh)}(hhh](h)}(hKernel *prdbg* APIh](hKernel }(hj hhhNhNubj")}(h*prdbg*h]hprdbg}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hj ubh API}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj hhhhhMlubh)}(hVThe following functions are cataloged and controllable when dynamic debug is enabled::h]hUThe following functions are cataloged and controllable when dynamic debug is enabled:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMnhj hhubj)}(hBpr_debug() dev_dbg() print_hex_dump_debug() print_hex_dump_bytes()h]hBpr_debug() dev_dbg() print_hex_dump_debug() print_hex_dump_bytes()}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMqhj hhubh)}(hOtherwise, they are off by default; ``ccflags += -DDEBUG`` or ``#define DEBUG`` in a source file will enable them appropriately.h](h$Otherwise, they are off by default; }(hj hhhNhNubh)}(h``ccflags += -DDEBUG``h]hccflags += -DDEBUG}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh or }(hj hhhNhNubh)}(h``#define DEBUG``h]h #define DEBUG}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh1 in a source file will enable them appropriately.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMvhj hhubh)}(hyIf ``CONFIG_DYNAMIC_DEBUG`` is not set, ``print_hex_dump_debug()`` is just a shortcut for ``print_hex_dump(KERN_DEBUG)``.h](hIf }(hj hhhNhNubh)}(h``CONFIG_DYNAMIC_DEBUG``h]hCONFIG_DYNAMIC_DEBUG}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh is not set, }(hj hhhNhNubh)}(h``print_hex_dump_debug()``h]hprint_hex_dump_debug()}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh is just a shortcut for }(hj hhhNhNubh)}(h``print_hex_dump(KERN_DEBUG)``h]hprint_hex_dump(KERN_DEBUG)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMyhj hhubh)}(hFor ``print_hex_dump_debug()``/``print_hex_dump_bytes()``, format string is its ``prefix_str`` argument, if it is constant string; or ``hexdump`` in case ``prefix_str`` is built dynamically.h](hFor }(hj8 hhhNhNubh)}(h``print_hex_dump_debug()``h]hprint_hex_dump_debug()}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8 ubh/}(hj8 hhhNhNubh)}(h``print_hex_dump_bytes()``h]hprint_hex_dump_bytes()}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8 ubh, format string is its }(hj8 hhhNhNubh)}(h``prefix_str``h]h prefix_str}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8 ubh( argument, if it is constant string; or }(hj8 hhhNhNubh)}(h ``hexdump``h]hhexdump}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8 ubh in case }(hj8 hhhNhNubh)}(h``prefix_str``h]h prefix_str}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8 ubh is built dynamically.}(hj8 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM|hj hhubeh}(h]kernel-prdbg-apiah ]h"]kernel prdbg apiah$]h&]uh1hhhhhhhhMlubeh}(h] dynamic-debugah ]h"] dynamic debugah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j j jWjTjjjijfjjjfjcj j j j j j} j j u nametypes}(j jWjjijjfj j j j uh}(j hjThjjZjfjjjljcjj jij j j} j j j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.