enable dynamic debug message for insmod

0

I am following instruction in https://www.kernel.org/doc/html/v4.15/admin-guide/dynamic-debug-howto.html#debug-messages-at-module-initialization-time, but I am not able to get the pr_debug printed during module initialization time.

module code : https://github.com/linux-kernel-labs/linux/blob/master/tools/labs/templates/kernel_modules/9-dyndbg/dyndbg.c

cmd : insmod dyndbg.ko dyndbg=\"func my_debug_func +p\"

By adding some debug trace messages, it is due to there is no module information for this newly inserted module as a result not get any match. But what puzzles me is that since this is newly inserted module, there is for sure no any information in the debug table.

My question is that is there anything I need to do to able to enable dynamic debug message during module initialization?

[  621.194241] dynamic_debug:ddebug_dyndbg_module_param_cb: module: dyndbg dyndbg="func my_debug_func +p"
[  621.196117] dynamic_debug:ddebug_exec_queries: query 0: "func my_debug_func +p"
[  621.197345] dynamic_debug:ddebug_tokenize: split into words: "func" "my_debug_func" "+p"
[  621.198768] dynamic_debug:ddebug_parse_flags: op='+'
[  621.199420] dynamic_debug:ddebug_parse_flags: flags=0x1
[  621.200097] dynamic_debug:ddebug_parse_flags: *flagsp=0x1 *maskp=0xffffffff
[  621.200972] dynamic_debug:vpr_info_dq: parsed: func="my_debug_func" file="" module="dyndbg" format="" lineno=0-0
[  621.201856] dynamic_debug:ddebug_change: [DEBUG] m:main, num:2
[  621.202577] dynamic_debug:ddebug_change: [DEBUG] m:initramfs, num:1
[  621.203117] dynamic_debug:ddebug_change: [DEBUG] m:ibs, num:3
[  621.203613] dynamic_debug:ddebug_change: [DEBUG] m:pt, num:2
[  621.204178] dynamic_debug:ddebug_change: [DEBUG] m:mtrr, num:2
[  621.204732] dynamic_debug:ddebug_change: [DEBUG] m:generic, num:7
... ( no any matching module name in ddebug_tables ) 
[  621.251807] dynamic_debug:ddebug_change: [DEBUG] m:ipv6, num:34
[  621.252303] dynamic_debug:ddebug_change: [DEBUG] m:sit, num:2
[  621.252790] dynamic_debug:ddebug_change: [DEBUG] m:ip6_checksum, num:2
[  621.253277] dynamic_debug:ddebug_change: [DEBUG] m:decompress, num:1
[  621.253765] dynamic_debug:ddebug_change: [DEBUG] m:kobject, num:10
[  621.254479] dynamic_debug:ddebug_change: [DEBUG] m:kobject_uevent, num:6
[  621.255000] dynamic_debug:ddebug_change: no matches for query
[  621.255653] dynamic_debug:vpr_info_dq: no-match: func="my_debug_func" file="" module="dyndbg" format="" lineno=0-0
[  621.256572] dynamic_debug:ddebug_exec_queries: processed 1 queries, with 0 matches, 0 errs
[  621.260458] Hi dyndbg!
linux
kernel
insmod
asked on Stack Overflow Jun 6, 2020 by ch001

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0