[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210529200029.205306-22-jim.cromie@gmail.com>
Date: Sat, 29 May 2021 14:00:16 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...mai.com, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org
Cc: Jim Cromie <jim.cromie@...il.com>
Subject: [RFC PATCH v6 21/34] dyndbg: ddebug_add_module() handle headers.
Now that header records are in the __dyndbg* sections,
ddebug_add_module() sees them when they're present (when adding
loadable modules and the 1st builtin, but not 2nd..Nth). Teach
ddebug_add_module() to recognize and account for them.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
lib/dynamic_debug.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index e4a22f7b153f..ad9971ded09a 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -1036,7 +1036,18 @@ static int __ddebug_add_module(struct _ddebug *tab, struct _ddebug_site *sites,
int i;
v3pr_info("add-module: %s.%d sites\n", modname, numdbgs);
- if (!numdbgs) {
+
+ if (numdbgs && is_dyndbg_header_pair(tab, sites)) {
+
+ v3pr_info(" header: %d %s.%s.%d\n", tab[0]._index, modname,
+ tab[0].site->function, tab[0].lineno);
+ WARN_ON(tab[0].site != &sites[0]);
+ if (numdbgs <= 1) {
+ v3pr_info(" skip header %s\n", modname);
+ return 0;
+ }
+
+ } else if (!numdbgs) {
v3pr_info(" skip %s\n", modname);
return 0;
}
--
2.31.1
Powered by blists - more mailing lists