summary refs log tree commit diff
path: root/kernel
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2022-09-04 15:40:52 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-07 17:04:49 +0200
commit66f4006b6ace1a1a1a1dca4225972f79a298e251 (patch)
tree319930012fddae2c0f0b086de2cfdf8aa973a4d6 /kernel
parentaad0214f30264c19044a77fc4776def349b76fc4 (diff)
downloadlinux-66f4006b6ace1a1a1a1dca4225972f79a298e251.tar.gz
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/module/main.c b/kernel/module/main.c
index a26b436ad992..00641d1022a5 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2113,6 +2113,8 @@ static int find_module_sections(struct module *mod, struct load_info *info)
 
 	info->dyndbg.descs = section_objs(info, "__dyndbg",
 					sizeof(*info->dyndbg.descs), &info->dyndbg.num_descs);
+	info->dyndbg.classes = section_objs(info, "__dyndbg_classes",
+					sizeof(*info->dyndbg.classes), &info->dyndbg.num_classes);
 
 	return 0;
 }