aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Kconfig.debug
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r--lib/Kconfig.debug72
1 files changed, 41 insertions, 31 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 0dd1c04c7323..8fee0a13ac58 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -848,59 +848,69 @@ config BUILD_DOCSRC
848 Say N if you are unsure. 848 Say N if you are unsure.
849 849
850config DYNAMIC_DEBUG 850config DYNAMIC_DEBUG
851 bool "Enable dynamic printk() call support" 851 bool "Enable dynamic printk() support"
852 default n 852 default n
853 depends on PRINTK 853 depends on PRINTK
854 depends on DEBUG_FS
854 select PRINTK_DEBUG 855 select PRINTK_DEBUG
855 help 856 help
856 857
857 Compiles debug level messages into the kernel, which would not 858 Compiles debug level messages into the kernel, which would not
858 otherwise be available at runtime. These messages can then be 859 otherwise be available at runtime. These messages can then be
859 enabled/disabled on a per module basis. This mechanism implicitly 860 enabled/disabled based on various levels of scope - per source file,
860 enables all pr_debug() and dev_dbg() calls. The impact of this 861 function, module, format string, and line number. This mechanism
861 compile option is a larger kernel text size of about 2%. 862 implicitly enables all pr_debug() and dev_dbg() calls. The impact of
863 this compile option is a larger kernel text size of about 2%.
862 864
863 Usage: 865 Usage:
864 866
865 Dynamic debugging is controlled by the debugfs file, 867 Dynamic debugging is controlled via the 'dynamic_debug/ddebug' file,
866 dynamic_printk/modules. This file contains a list of the modules that 868 which is contained in the 'debugfs' filesystem. Thus, the debugfs
867 can be enabled. The format of the file is the module name, followed 869 filesystem must first be mounted before making use of this feature.
868 by a set of flags that can be enabled. The first flag is always the 870 We refer the control file as: <debugfs>/dynamic_debug/ddebug. This
869 'enabled' flag. For example: 871 file contains a list of the debug statements that can be enabled. The
872 format for each line of the file is:
870 873
871 <module_name> <enabled=0/1> 874 filename:lineno [module]function flags format
872 .
873 .
874 .
875 875
876 <module_name> : Name of the module in which the debug call resides 876 filename : source file of the debug statement
877 <enabled=0/1> : whether the messages are enabled or not 877 lineno : line number of the debug statement
878 module : module that contains the debug statement
879 function : function that contains the debug statement
880 flags : 'p' means the line is turned 'on' for printing
881 format : the format used for the debug statement
878 882
879 From a live system: 883 From a live system:
880 884
881 snd_hda_intel enabled=0 885 nullarbor:~ # cat <debugfs>/dynamic_debug/ddebug
882 fixup enabled=0 886 # filename:lineno [module]function flags format
883 driver enabled=0 887 fs/aio.c:222 [aio]__put_ioctx - "__put_ioctx:\040freeing\040%p\012"
888 fs/aio.c:248 [aio]ioctx_alloc - "ENOMEM:\040nr_events\040too\040high\012"
889 fs/aio.c:1770 [aio]sys_io_cancel - "calling\040cancel\012"
884 890
885 Enable a module: 891 Example usage:
886 892
887 $echo "set enabled=1 <module_name>" > dynamic_printk/modules 893 // enable the message at line 1603 of file svcsock.c
894 nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
895 <debugfs>/dynamic_debug/ddebug
888 896
889 Disable a module: 897 // enable all the messages in file svcsock.c
898 nullarbor:~ # echo -n 'file svcsock.c +p' >
899 <debugfs>/dynamic_debug/ddebug
890 900
891 $echo "set enabled=0 <module_name>" > dynamic_printk/modules 901 // enable all the messages in the NFS server module
902 nullarbor:~ # echo -n 'module nfsd +p' >
903 <debugfs>/dynamic_debug/ddebug
892 904
893 Enable all modules: 905 // enable all 12 messages in the function svc_process()
906 nullarbor:~ # echo -n 'func svc_process +p' >
907 <debugfs>/dynamic_debug/ddebug
894 908
895 $echo "set enabled=1 all" > dynamic_printk/modules 909 // disable all 12 messages in the function svc_process()
910 nullarbor:~ # echo -n 'func svc_process -p' >
911 <debugfs>/dynamic_debug/ddebug
896 912
897 Disable all modules: 913 See Documentation/dynamic-debug-howto.txt for additional information.
898
899 $echo "set enabled=0 all" > dynamic_printk/modules
900
901 Finally, passing "dynamic_printk" at the command line enables
902 debugging for all modules. This mode can be turned off via the above
903 disable command.
904 914
905source "samples/Kconfig" 915source "samples/Kconfig"
906 916