mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
kernel/module: add __dyndbg_classes section
Add __dyndbg_classes section, using __dyndbg as a model. Use it: vmlinux.lds.h: KEEP the new section, which also silences orphan section warning on loadable modules. Add (__start_/__stop_)__dyndbg_classes linker symbols for the c externs (below). kernel/module/main.c: - fill new fields in find_module_sections(), using section_objs() - extend callchain prototypes to pass classes, length load_module(): pass new info to dynamic_debug_setup() dynamic_debug_setup(): new params, pass through to ddebug_add_module() dynamic_debug.c: - add externs to the linker symbols. ddebug_add_module(): - It currently builds a debug_table, and *will* find and attach classes. dynamic_debug_init(): - add class fields to the _ddebug_info cursor var: di. Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Link: https://lore.kernel.org/r/20220904214134.408619-16-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
aad0214f30
commit
66f4006b6a
@@ -41,6 +41,8 @@
|
||||
|
||||
extern struct _ddebug __start___dyndbg[];
|
||||
extern struct _ddebug __stop___dyndbg[];
|
||||
extern struct ddebug_class_map __start___dyndbg_classes[];
|
||||
extern struct ddebug_class_map __stop___dyndbg_classes[];
|
||||
|
||||
struct ddebug_table {
|
||||
struct list_head link;
|
||||
@@ -1079,7 +1081,9 @@ static int __init dynamic_debug_init(void)
|
||||
|
||||
struct _ddebug_info di = {
|
||||
.descs = __start___dyndbg,
|
||||
.classes = __start___dyndbg_classes,
|
||||
.num_descs = __stop___dyndbg - __start___dyndbg,
|
||||
.num_classes = __stop___dyndbg_classes - __start___dyndbg_classes,
|
||||
};
|
||||
|
||||
if (&__start___dyndbg == &__stop___dyndbg) {
|
||||
@@ -1122,6 +1126,9 @@ static int __init dynamic_debug_init(void)
|
||||
i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10),
|
||||
(int)((i * sizeof(struct _ddebug)) >> 10));
|
||||
|
||||
if (di.num_classes)
|
||||
v2pr_info(" %d builtin ddebug class-maps\n", di.num_classes);
|
||||
|
||||
/* now that ddebug tables are loaded, process all boot args
|
||||
* again to find and activate queries given in dyndbg params.
|
||||
* While this has already been done for known boot params, it
|
||||
|
Reference in New Issue
Block a user