Difference between revisions of "How to use the kernel dynamic debug"

[quality revision] [unchecked revision]
m
m (Reverted edits by Jean Christophe Trotin (talk) to last revision by Frq07399)
(Tag: Rollback)

Template:ArticleMainWriter

Template:ArticleApprovedVersion


1 Introduction[edit]

As prerequisite to reading this article, please refer to the Dmesg and Linux kernel log page.

"Dynamic debug is designed to allow you to dynamically enable/disable kernel code to obtain additional kernel information. Currently, if CONFIG_DYNAMIC_DEBUG is set, all pr_debug()/dev_dbg() calls can be dynamically enabled per-callsite." extracted from the Linux kernel documentation[1].

The related debugfs entry is usually:

/sys/kernel/debug/dynamic_debug/control

Note that the verbose dev_vdbg() calls cannot be dynamically activated.

When the dynamic debug traces are activated, the trace results are printed in dmesg (or /proc/kmsg), and in the console if console loglevel is set to 8.

2 More technical information[edit]

The dynamic debug trace configuration is done through a control file in the debugfs filesystem: <debugfs>/dynamic_debug/control

The command includes keywords and flag elements (for details see the Linux kernel documentation[1]).

  • Keywords

Possible keywords are:

func : function name
file : source filename
moduleTemplate:Blue : module name
format : format string
line : line number (including ranges of line numbers)

The colored keywords above are illustrated by examples in the next chapter.
  • Flags

The flag specification comprises a change operation followed by one or more flag characters. The change operation is one of the characters:

- : remove the given flags
+ : add the given flags
= : set the flags to the given flags

Possible flags are:

f : Include the function name in the printed message
l : Include line number in the printed message
m : Include module name in the printed message
p : Causes a printk() message to be emitted to dmesg
t : Include thread ID in messages not generated from interrupt context

3 Examples[edit]

  • Track all dev_*dbg/pr_debug() in a file (you can add several files if necessary):
 mount -t debugfs none /sys/kernel/debug
 echo "file stm32-adc.c +p" > /sys/kernel/debug/dynamic_debug/control

Note that just the file name or full file path can be given, here stm32-adc.c or drivers/iio/adc/stm32-adc.c

  • Track only one line with dev_dbg() in a file (you can add several files and several lines if necessary, please use the last line number of the function call):
 echo "file stm32-adc.c line 1438 +p" > /sys/kernel/debug/dynamic_debug/control
  • For an entire "module Template:Blue (module means ~.ko, so not applicable for a statically linked driver)":
 echo "moduleTemplate:Blue cfg80211 +p" > /sys/kernel/debug/dynamic_debug/control
  • If you want to list all available traces (warning: it is a long file so you may need to use "tee" or another solution to save it):
 cat /sys/kernel/debug/dynamic_debug/control | tee /tmp/dynamic_log.log

  • For instance, if you are looking for a particular file to find a particular line:
 cat /sys/kernel/debug/dynamic_debug/control | grep adc
drivers/iio/adc/stm32-adc.c:1515 [stm32_adc]stm32_adc_conf_scan_seq =p "%s chan %d to %s%d\012"
drivers/iio/adc/stm32-adc.c:1438 [stm32_adc]stm32_adc_awd_set =p "%s chan%d htr:%d ltr:%d\012"
drivers/iio/adc/stm32-adc.c:2182 [stm32_adc]stm32_adc_dma_start =p "%s size=%d watermark=%d\012"
drivers/iio/adc/stm32-adc.c:2304 [stm32_adc]stm32_adc_trigger_handler =p "%s bufi=%d\012"
drivers/iio/adc/stm32-adc.c:2443 [stm32_adc]stm32_adc_chan_of_init =p "Configured to use injected\012"
drivers/iio/adc/stm32-adc.c:2364 [stm32_adc]stm32_adc_of_get_resolution =p "Using %u bits resolution\012"
  • Multiple commands can be written together, separated by ';' or '\n'.
 echo "file stm32-adc.c +p; file stm32-adc-core.c +p" > /sys/kernel/debug/dynamic_debug/control
  • A another method is to use a wildcard. 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" > /sys/kernel/debug/dynamic_debug/control

4 Synchronous tracing on the console[edit]

In the case of a crash, or impossibility to call dmesg, it is sometimes useful to have traces synchronously emitted on the console.
Only error, warning and informational traces are emitted synchronously on the console (that is, loglevel=5), so if you need to see the lower level traces too, you need to change the console loglevel to "8".

<enable the conditional traces>
 echo 8 > /proc/sys/kernel/printk
or
 dmesg -n 8
or
 dmesg -n debug

Please follow this article to get a serial console for the target: How to get Terminal

Warning white.png Warning
As all traces are now synchronously emitted, real-time is affected

If you want to return to the default console log level, you have to get this default value from the procfs entry /proc/sys/kernel/printk:

 cat /proc/sys/kernel/printk
8	4	1	7
 dmesg -n 7
 cat /proc/sys/kernel/printk
7	4	1	7

5 Debug messages during boot process[edit]

In order to activate debug messages during the boot process, even before userspace and debugfs exist, use the kernel's command-line parameter: dyndbg

For instance, the kernel bootargs can be modified in the following ways:

  • Mount a boot partition from the Linux kernel console, and then update the extlinux.conf file using the vi editor (see man page[2], or introduction page[3] ). For example:
 mount /dev/mmcblk0p4 /boot
 vi /boot/mmc0_stm32mp157c-ev1_extlinux/extlinux.conf

or

To mount partitions (mmc 0:microSD card / mmc 1: eMMC):

- Press any key to stop at U-Boot execution when booting the board.
 ...
 Hit any key to stop autoboot:  0
 STM32MP>
- Then
STM32MP> ums 0 mmc 0
- Check for the boot partition mounted on your host PC (/media/$USER/bootfs)
- Edit the extlinux file corresponding to your setup (/media/$USER/bootfs/mmc0_stm32mp157c-ev2_extlinux/extlinux.conf
  • Update the kernel command line, adding the dyndbg parameter:
root=/dev/mmcblk0p5 rootwait rw console=ttyS3,115200 dyndbg="file drivers/usb/core/hub.c +p"

Save and quit file update, and then reboot the board.

Note: to display these debug messages in the console, in addition to the dmesg, add loglevel=8 in the kernel command line.

  • Reboot the board and check for a kernel command-line, and that debug messages are present in the dmesg output

6 References[edit]


  • Useful external links
Document link Document Type Description
The dynamic debugging interface (lwn.net) User guide http://lwn.net
Documentation/dynamic-debug-howto.txt (lwn.txt) User guide http://lwn.net
Dynamic debug howto (kernel.org) Standard http://www.kernel.org
<noinclude>

{{ArticleMainWriter | Jean-PhilippeR}}

{{ ArticleApprovedVersion | Jean-PhilippeR | Jean-ChristopheT, AlexandreT | No previous approved version  | PhilipS - 05Nov'18 - 9237 | 05Nov'18 }}

[[Category:How to trace and debug]]</noinclude>

== Introduction ==
As prerequisite to reading this article, please refer to the [[Dmesg and Linux kernel log]] page.

"Dynamic debug is designed to allow you to dynamically enable/disable kernel code to obtain additional kernel information. Currently, if '''CONFIG_DYNAMIC_DEBUG''' is set, all {{Highlight|'''pr_debug()/dev_dbg()'''}} calls can be dynamically enabled per-callsite." extracted from the Linux kernel documentation<ref name="dynamic-debug-howto.rst">{{CodeSource | Linux kernel | Documentation/admin-guide/dynamic-debug-howto.rst}}</ref>.

The related debugfs entry is usually:
 /sys/kernel/debug/{{highlight|dynamic_debug/control}}

Note that the verbose '''{{Highlight|dev_vdbg()}}''' calls cannot be dynamically activated.

When the dynamic debug traces are activated, the trace results are printed in '''dmesg (or /proc/kmsg)''', and in the console if console loglevel is set to 8.

== More technical information ==
The dynamic debug trace configuration is done through a '''control''' file in the '''debugfs''' filesystem: ''{{HighlightParamorange|<debugfs>}}{{highlight|/dynamic_debug/control}}''

The command includes keywords and flag elements (for details see the Linux kernel documentation<ref name="dynamic-debug-howto.rst"/>).

*Keywords
Possible keywords are:
 '''func''' '': function name''<span style="color: green;">{{Green|'''file'''</span>}} '': source filename''<span style="color: blue;">{{Blue|'''module'''</span>}} '': module name''
 '''format''' '': format string''<span style="color: orange;">{{Orange|'''line'''</span>}} '': line number (including ranges of line numbers)''
:The colored keywords above are illustrated by examples in the next chapter.

*Flags
The flag specification comprises a change operation followed by one or more flag characters.  The change operation is one of the characters:
 - '': remove the given flags''
 '''+''' '': add the given flags''
 = '': set the flags to the given flags''

Possible flags are:
 f '': Include the function name in the printed message''
 l '': Include line number in the printed message''
 m '': Include module name in the printed message''
 '''p''' '': Causes a printk() message to be emitted to dmesg''
 t '': Include thread ID in messages not generated from interrupt context''

==Examples==
* Track all dev_*dbg/pr_debug() in a <span style="color: green;">{{Green|'''file'''</span>}} (you can add several files if necessary):
 {{Board$}} mount -t debugfs none /sys/kernel/debug
 {{Board$}} echo "<span style="color: green;">{{Green|'''file'''</span>}} stm32-adc.c '''+p'''" > /sys/kernel/debug/dynamic_debug/control
Note that just the file name or full file path can be given, here ''stm32-adc.c'' or ''drivers/iio/adc/stm32-adc.c''

* Track only one <span style="color: orange;">{{Orange|'''line'''</span>}} with dev_dbg() in a <span style="color: green;">{{Green|'''file'''</span>}} (you can add several files and several lines if necessary, please use the last line number of the function call):
 {{Board$}} echo "<span style="color: green;">{{Green|'''file'''</span>}} stm32-adc.c <span style="color: orange;">{{Orange|'''line'''</span>}} 1438 '''+p'''" > /sys/kernel/debug/dynamic_debug/control

* For an entire "<span style="color: blue;">{{Blue|'''module'''</span>}} (module means ~.ko, so not applicable for a statically linked driver)":
 {{Board$}} echo "<span style="color: blue;">{{Blue|'''module'''</span>}} cfg80211 '''+p'''" > /sys/kernel/debug/dynamic_debug/control

* If you want to list all available traces {{Grey|''(warning: it is a long file so you may need to use "tee" or another solution to save it)''}}:
 {{Board$}} cat /sys/kernel/debug/dynamic_debug/control {{Grey|''&#124; tee /tmp/dynamic_log.log''}}

* For instance, if you are looking for a particular <span style="color: green;">{{Green|'''file'''</span>}} to find a particular <span style="color: orange;">{{Orange|'''line'''</span>}}:
 {{Board$}} cat /sys/kernel/debug/dynamic_debug/control | grep adc<span style="color: green;">{{Green|drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">1515</span>}}:{{Orange|1515}} [stm32_adc]stm32_adc_conf_scan_seq =p "%s chan %d to %s%d\012"<span style="color: green;">{{Green|drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">1438</span>}}:{{Orange|1438}} [stm32_adc]stm32_adc_awd_set =p "%s chan%d htr:%d ltr:%d\012"<span style="color: green;">{{Green|drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2182</span>}}:{{Orange|2182}} [stm32_adc]stm32_adc_dma_start =p "%s size=%d watermark=%d\012"<span style="color: green;">{{Green|drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2304</span>}}:{{Orange|2304}} [stm32_adc]stm32_adc_trigger_handler =p "%s bufi=%d\012"<span style="color: green;">{{Green|drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2443</span>}}:{{Orange|2443}} [stm32_adc]stm32_adc_chan_of_init =p "Configured to use injected\012"<span style="color: green;">{{Green|drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2364</span>}}:{{Orange|2364}} [stm32_adc]stm32_adc_of_get_resolution =p "Using %u bits resolution\012"

* Multiple commands can be written together, separated by ';' or '\n'.
 {{Board$}} echo "<span style="color: green;">{{Green|'''file'''</span>}} stm32-adc.c '''+p'''; <span style="color: green;">{{Green|'''file'''</span>}} stm32-adc-core.c '''+p'''" > /sys/kernel/debug/dynamic_debug/control

* A another method is to use a wildcard. The match rule supports * (matches zero or more characters) and ? (matches exactly one character). For example, you can match all USB drivers:
 {{Board$}} echo "<span style="color: green;">{{Green|'''file'''</span>}} drivers/usb/* '''+p'''" > /sys/kernel/debug/dynamic_debug/control

== Synchronous tracing on the console ==
In the case of a crash, or impossibility to call dmesg, it is sometimes useful to have traces synchronously emitted on the console.<br>

Only error, warning and informational traces are emitted synchronously on the console (that is, loglevel=5), so if you need to see the lower level traces too, you need to change the console loglevel to "8".
<enable the conditional traces>

 {{Board$}} echo 8 > /proc/sys/kernel/printk
 or
 {{Board$}} dmesg -n 8
 or
 {{Board$}} dmesg -n debug

Please follow this article to get a serial console for the target: [[How to get Terminal]]
{{Warning |As all traces are now synchronously emitted, real-time is affected<br/>

If you want to return to the default console log level, you have to get this default value from the procfs entry ''/proc/sys/kernel/printk'':<br/>

 {{Board$}} cat /proc/sys/kernel/printk
 8	4	1	{{highlight|'''7'''}}
 {{Board$}} dmesg -n {{highlight|'''7'''}}
 {{Board$}} cat /proc/sys/kernel/printk
 {{highlight|'''7'''}}	4	1	7
}}

==Debug messages during boot process==
In order to activate debug messages during the boot process, even before userspace and debugfs exist, use the kernel's command-line parameter: {{Highlight|'''dyndbg'''}}

For instance, the kernel ''bootargs'' can be modified in the following ways:<br>

* Mount a boot partition from the Linux kernel console, and then update the extlinux.conf file using the vi editor (see man page<ref>http://ex-vi.sourceforge.net/vi.html</ref>, or introduction page<ref>http://ex-vi.sourceforge.net/viin/paper.html</ref> ). For example:
 {{Board$}} mount /dev/mmcblk0p4 /boot
 {{Board$}} vi /boot/mmc0_stm32mp157c-ev1_extlinux/extlinux.conf

or
* Edit the extlinux.conf file by using UMS (USB Mass Storage): see [[How to use USB mass storage in U-Boot]] for details.

To mount partitions (mmc 0:microSD card / mmc 1: eMMC):
:- Press any key to stop at U-Boot execution when booting the board.
 {{Board$}} ...
 {{Board$}} Hit any key to stop autoboot:  0
 {{Board$}} STM32MP>

:- Then
 STM32MP> ums 0 mmc 0

:- Check for the boot partition mounted on your host PC (/media/''$USER''/bootfs)<br>

:- Edit the extlinux file corresponding to your setup (/media/''$USER''/bootfs/mmc0_stm32mp157c-ev2_extlinux/extlinux.conf<br>


* Update the kernel command line, adding the dyndbg parameter:
 root=/dev/mmcblk0p5 rootwait rw console=ttyS3,115200 '''dyndbg="<span style="color: green;">{{Green|file</span>}} drivers/usb/core/hub.c +p"'''
Save and quit file update, and then reboot the board.

'''Note''': to display these debug messages in the console, in addition to the dmesg, add '''loglevel=8''' in the kernel command line.

* Reboot the board and check for a kernel command-line, and that debug messages are present in the dmesg output<br>


== References ==<references />


* Useful external links
{|
! scope=col | Document link
! scope=col | Document Type
! scope=col | Description
|-
| [http://lwn.net/Articles/434833/ The dynamic debugging interface (lwn.net)]
| User guide
| http://lwn.net
|-
| [http://lwn.net/Articles/434856/ Documentation/dynamic-debug-howto.txt (lwn.txt)]
| User guide
| http://lwn.net
|-
| [https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html Dynamic debug howto (kernel.org)]
| Standard
| http://www.kernel.org
|}

<noinclude>

{{PublicationRequestId | 9237 | 2018-11-05 | PhilipS}}
[[Category:How to trace and debug]]</noinclude>
Line 1: Line 1:
  +
<noinclude>
  +
{{ArticleMainWriter | Jean-PhilippeR}}
  +
  +
{{ ArticleApprovedVersion | Jean-PhilippeR | Jean-ChristopheT, AlexandreT | No previous approved version  | PhilipS - 05Nov'18 - 9237 | 05Nov'18 }}
  +
  +
[[Category:How to trace and debug]]
  +
</noinclude>
  +
 
== Introduction ==
 
== Introduction ==
 
As prerequisite to reading this article, please refer to the [[Dmesg and Linux kernel log]] page.
 
As prerequisite to reading this article, please refer to the [[Dmesg and Linux kernel log]] page.
Line 12: Line 20:
   
 
== More technical information ==
 
== More technical information ==
The dynamic debug trace configuration is done through a '''control''' file in the '''debugfs''' filesystem: ''{{HighlightParam|<debugfs>}}{{highlight|/dynamic_debug/control}}''
+
The dynamic debug trace configuration is done through a '''control''' file in the '''debugfs''' filesystem: ''{{orange|<debugfs>}}{{highlight|/dynamic_debug/control}}''
   
 
The command includes keywords and flag elements (for details see the Linux kernel documentation<ref name="dynamic-debug-howto.rst"/>).
 
The command includes keywords and flag elements (for details see the Linux kernel documentation<ref name="dynamic-debug-howto.rst"/>).
Line 19: Line 27:
 
Possible keywords are:
 
Possible keywords are:
 
  '''func''' '': function name''
 
  '''func''' '': function name''
  <span style="color: green;">'''file'''</span> '': source filename''
+
  {{Green|'''file'''}} '': source filename''
  <span style="color: blue;">'''module'''</span> '': module name''
+
  {{Blue|'''module'''}} '': module name''
 
  '''format''' '': format string''
 
  '''format''' '': format string''
  <span style="color: orange;">'''line'''</span> '': line number (including ranges of line numbers)''
+
  {{Orange|'''line'''}} '': line number (including ranges of line numbers)''
 
:The colored keywords above are illustrated by examples in the next chapter.
 
:The colored keywords above are illustrated by examples in the next chapter.
   
Line 39: Line 47:
   
 
==Examples==
 
==Examples==
* Track all dev_*dbg/pr_debug() in a <span style="color: green;">'''file'''</span> (you can add several files if necessary):
+
* Track all dev_*dbg/pr_debug() in a {{Green|'''file'''}} (you can add several files if necessary):
 
  {{Board$}} mount -t debugfs none /sys/kernel/debug
 
  {{Board$}} mount -t debugfs none /sys/kernel/debug
  {{Board$}} echo "<span style="color: green;">'''file'''</span> stm32-adc.c '''+p'''" > /sys/kernel/debug/dynamic_debug/control
+
  {{Board$}} echo "{{Green|'''file'''}} stm32-adc.c '''+p'''" > /sys/kernel/debug/dynamic_debug/control
 
Note that just the file name or full file path can be given, here ''stm32-adc.c'' or ''drivers/iio/adc/stm32-adc.c''
 
Note that just the file name or full file path can be given, here ''stm32-adc.c'' or ''drivers/iio/adc/stm32-adc.c''
   
* Track only one <span style="color: orange;">'''line'''</span> with dev_dbg() in a <span style="color: green;">'''file'''</span> (you can add several files and several lines if necessary, please use the last line number of the function call):
+
* Track only one {{Orange|'''line'''}} with dev_dbg() in a {{Green|'''file'''}} (you can add several files and several lines if necessary, please use the last line number of the function call):
  {{Board$}} echo "<span style="color: green;">'''file'''</span> stm32-adc.c <span style="color: orange;">'''line'''</span> 1438 '''+p'''" > /sys/kernel/debug/dynamic_debug/control
+
  {{Board$}} echo "{{Green|'''file'''}} stm32-adc.c {{Orange|'''line'''}} 1438 '''+p'''" > /sys/kernel/debug/dynamic_debug/control
   
* For an entire "<span style="color: blue;">'''module'''</span> (module means ~.ko, so not applicable for a statically linked driver)":
+
* For an entire "{{Blue|'''module'''}} (module means ~.ko, so not applicable for a statically linked driver)":
  {{Board$}} echo "<span style="color: blue;">'''module'''</span> cfg80211 '''+p'''" > /sys/kernel/debug/dynamic_debug/control
+
  {{Board$}} echo "{{Blue|'''module'''}} cfg80211 '''+p'''" > /sys/kernel/debug/dynamic_debug/control
   
 
* If you want to list all available traces {{Grey|''(warning: it is a long file so you may need to use "tee" or another solution to save it)''}}:
 
* If you want to list all available traces {{Grey|''(warning: it is a long file so you may need to use "tee" or another solution to save it)''}}:
 
  {{Board$}} cat /sys/kernel/debug/dynamic_debug/control {{Grey|''&#124; tee /tmp/dynamic_log.log''}}
 
  {{Board$}} cat /sys/kernel/debug/dynamic_debug/control {{Grey|''&#124; tee /tmp/dynamic_log.log''}}
   
* For instance, if you are looking for a particular <span style="color: green;">'''file'''</span> to find a particular <span style="color: orange;">'''line'''</span>:
+
* For instance, if you are looking for a particular {{Green|'''file'''}} to find a particular {{Orange|'''line'''}}:
 
  {{Board$}} cat /sys/kernel/debug/dynamic_debug/control | grep adc
 
  {{Board$}} cat /sys/kernel/debug/dynamic_debug/control | grep adc
  <span style="color: green;">drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">1515</span> [stm32_adc]stm32_adc_conf_scan_seq =p "%s chan %d to %s%d\012"
+
  {{Green|drivers/iio/adc/stm32-adc.c}}:{{Orange|1515}} [stm32_adc]stm32_adc_conf_scan_seq =p "%s chan %d to %s%d\012"
  <span style="color: green;">drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">1438</span> [stm32_adc]stm32_adc_awd_set =p "%s chan%d htr:%d ltr:%d\012"
+
  {{Green|drivers/iio/adc/stm32-adc.c}}:{{Orange|1438}} [stm32_adc]stm32_adc_awd_set =p "%s chan%d htr:%d ltr:%d\012"
  <span style="color: green;">drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2182</span> [stm32_adc]stm32_adc_dma_start =p "%s size=%d watermark=%d\012"
+
  {{Green|drivers/iio/adc/stm32-adc.c}}:{{Orange|2182}} [stm32_adc]stm32_adc_dma_start =p "%s size=%d watermark=%d\012"
  <span style="color: green;">drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2304</span> [stm32_adc]stm32_adc_trigger_handler =p "%s bufi=%d\012"
+
  {{Green|drivers/iio/adc/stm32-adc.c}}:{{Orange|2304}} [stm32_adc]stm32_adc_trigger_handler =p "%s bufi=%d\012"
  <span style="color: green;">drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2443</span> [stm32_adc]stm32_adc_chan_of_init =p "Configured to use injected\012"
+
  {{Green|drivers/iio/adc/stm32-adc.c}}:{{Orange|2443}} [stm32_adc]stm32_adc_chan_of_init =p "Configured to use injected\012"
  <span style="color: green;">drivers/iio/adc/stm32-adc.c</span>:<span style="color: orange;">2364</span> [stm32_adc]stm32_adc_of_get_resolution =p "Using %u bits resolution\012"
+
  {{Green|drivers/iio/adc/stm32-adc.c}}:{{Orange|2364}} [stm32_adc]stm32_adc_of_get_resolution =p "Using %u bits resolution\012"
   
 
* Multiple commands can be written together, separated by ';' or '\n'.
 
* Multiple commands can be written together, separated by ';' or '\n'.
  {{Board$}} echo "<span style="color: green;">'''file'''</span> stm32-adc.c '''+p'''; <span style="color: green;">'''file'''</span> stm32-adc-core.c '''+p'''" > /sys/kernel/debug/dynamic_debug/control
+
  {{Board$}} echo "{{Green|'''file'''}} stm32-adc.c '''+p'''; {{Green|'''file'''}} stm32-adc-core.c '''+p'''" > /sys/kernel/debug/dynamic_debug/control
   
 
* A another method is to use a wildcard. The match rule supports * (matches zero or more characters) and ? (matches exactly one character). For example, you can match all USB drivers:
 
* A another method is to use a wildcard. The match rule supports * (matches zero or more characters) and ? (matches exactly one character). For example, you can match all USB drivers:
  {{Board$}} echo "<span style="color: green;">'''file'''</span> drivers/usb/* '''+p'''" > /sys/kernel/debug/dynamic_debug/control
+
  {{Board$}} echo "{{Green|'''file'''}} drivers/usb/* '''+p'''" > /sys/kernel/debug/dynamic_debug/control
   
 
== Synchronous tracing on the console ==
 
== Synchronous tracing on the console ==
Line 113: Line 121:
   
 
* Update the kernel command line, adding the dyndbg parameter:
 
* Update the kernel command line, adding the dyndbg parameter:
  root=/dev/mmcblk0p5 rootwait rw console=ttyS3,115200 '''dyndbg="<span style="color: green;">file</span> drivers/usb/core/hub.c +p"'''
+
  root=/dev/mmcblk0p5 rootwait rw console=ttyS3,115200 '''dyndbg="{{Green|file}} drivers/usb/core/hub.c +p"'''
 
Save and quit file update, and then reboot the board.
 
Save and quit file update, and then reboot the board.
   
Line 142: Line 150:
 
| http://www.kernel.org
 
| http://www.kernel.org
 
|}
 
|}
 
<noinclude>
 
{{PublicationRequestId | 9237 | 2018-11-05 | PhilipS}}
 
[[Category:How to trace and debug]]
 
</noinclude>