FROMLIST: BACKPORT: dynamic_debug: Add an option to enable dynamic debug for modules only

Instead of enabling dynamic debug globally with CONFIG_DYNAMIC_DEBUG,
CONFIG_DYNAMIC_DEBUG_CORE will only enable core function of dynamic
debug. With the DYNAMIC_DEBUG_MODULE defined for any modules, dynamic
debug will be tied to them.

This is useful for people who only want to enable dynamic debug for
kernel modules without worrying about kernel image size and memory
consumption is increasing too much.

Change-Id: I27de392de2e2545afa8dcbe096deadb252537905
Signed-off-by: Orson Zhai <orson.zhai@unisoc.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 145162121
Link: https://lore.kernel.org/lkml/1587408228-10861-1-git-send-email-orson.unisoc@gmail.com/
This commit is contained in:
Orson Zhai
2020-04-10 19:46:30 +08:00
committed by Todd Kjos
parent e5d4e9f071
commit 13854bd88c
10 changed files with 49 additions and 16 deletions

View File

@@ -48,7 +48,7 @@ struct _ddebug {
#if defined(CONFIG_DYNAMIC_DEBUG)
#if defined(CONFIG_DYNAMIC_DEBUG_CORE)
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
const char *modname);
extern int ddebug_remove_module(const char *mod_name);