diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2023-07-09 23:18:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-04 15:28:41 +0200 |
commit | 31ed379b7cb2b5c1f2abc7255ff31c30bab26066 (patch) | |
tree | d92d52c2ae74c454dd62e925ab685ad97855c9bb /include/linux/dynamic_debug.h | |
parent | 3bdaf739057e80811a9c299115d3272a69276049 (diff) | |
download | linux-31ed379b7cb2b5c1f2abc7255ff31c30bab26066.tar.gz linux-31ed379b7cb2b5c1f2abc7255ff31c30bab26066.tar.bz2 linux-31ed379b7cb2b5c1f2abc7255ff31c30bab26066.zip |
dyndbg: add source filename to prefix
Printing the line number without the file is of limited usefulness.
Knowing the filename also makes it also easier to relate the logged
information to the controlfile.
Example:
# modprobe test_dynamic_debug
# echo 'file test_dynamic_debug.c =pfsl' > /proc/dynamic_debug/control
# echo 1 > /sys/module/test_dynamic_debug/parameters/do_prints
# dmesg | tail -2
[ 71.802212] do_cats:lib/test_dynamic_debug.c:103: test_dd: doing categories
[ 71.802227] do_levels:lib/test_dynamic_debug.c:123: test_dd: doing levels
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jason Baron <jbaron@akamai.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20230709-dyndbg-filename-v2-3-fd83beef0925@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/dynamic_debug.h')
-rw-r--r-- | include/linux/dynamic_debug.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 061dd84d09f3..4fcbf4d4fd0a 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -37,10 +37,12 @@ struct _ddebug { #define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2) #define _DPRINTK_FLAGS_INCL_LINENO (1<<3) #define _DPRINTK_FLAGS_INCL_TID (1<<4) +#define _DPRINTK_FLAGS_INCL_SOURCENAME (1<<5) #define _DPRINTK_FLAGS_INCL_ANY \ (_DPRINTK_FLAGS_INCL_MODNAME | _DPRINTK_FLAGS_INCL_FUNCNAME |\ - _DPRINTK_FLAGS_INCL_LINENO | _DPRINTK_FLAGS_INCL_TID) + _DPRINTK_FLAGS_INCL_LINENO | _DPRINTK_FLAGS_INCL_TID |\ + _DPRINTK_FLAGS_INCL_SOURCENAME) #if defined DEBUG #define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT |