linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: david@redhat.com, Liam.Howlett@Oracle.com, linux-mm@kvack.org,
	Jim Cromie <jim.cromie@gmail.com>
Subject: [RFC PATCH 03/10] dyndbg: add 2nd cursor pair to init-fn
Date: Thu, 12 Oct 2023 13:47:04 -0600	[thread overview]
Message-ID: <20231012194711.3288031-4-jim.cromie@gmail.com> (raw)
In-Reply-To: <20231012194711.3288031-1-jim.cromie@gmail.com>

In dynamic_debug_init(), add 2nd cursor pair to walk the
__dyndbg_sites section in parallel with the __dyndbg section.

This avoids using the _ddebug.site pointer during initialization,
which is a 1st step towards dropping the member entirely, and reducing
the struct size and section footprint.

no functional change

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 lib/dynamic_debug.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 0ad9f1bc00f0..51af6a75ae92 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -1501,6 +1501,7 @@ static int __init dynamic_debug_init_control(void)
 
 static int __init dynamic_debug_init(void)
 {
+	struct _ddebug_site *site, *site_mod_start;
 	struct _ddebug *iter, *iter_mod_start;
 	int ret, i, mod_sites, mod_ct;
 	const char *modname;
@@ -1508,9 +1509,11 @@ static int __init dynamic_debug_init(void)
 
 	struct _ddebug_info di = {
 		.descs = __start___dyndbg,
+		.sites = __start___dyndbg_sites,
 		.classes = __start___dyndbg_classes,
 		.class_users = __start___dyndbg_class_users,
 		.num_descs = __stop___dyndbg - __start___dyndbg,
+		.num_sites = __stop___dyndbg_sites - __start___dyndbg_sites,
 		.num_classes = __stop___dyndbg_classes - __start___dyndbg_classes,
 		.num_class_users = __stop___dyndbg_class_users - __start___dyndbg_class_users,
 	};
@@ -1533,16 +1536,19 @@ static int __init dynamic_debug_init(void)
 		return 0;
 	}
 
+	site = site_mod_start = di.sites;
 	iter = iter_mod_start = __start___dyndbg;
 	modname = desc_modname(iter);
 	i = mod_sites = mod_ct = 0;
 
-	for (; iter < __stop___dyndbg; iter++, i++, mod_sites++) {
+	for (; iter < __stop___dyndbg; iter++, site++, i++, mod_sites++) {
 
 		if (strcmp(modname, desc_modname(iter))) {
 			mod_ct++;
 			di.num_descs = mod_sites;
+			di.num_sites = mod_sites;
 			di.descs = iter_mod_start;
+			di.sites = site_mod_start;
 			ret = ddebug_add_module(&di, modname);
 			if (ret)
 				goto out_err;
@@ -1550,10 +1556,13 @@ static int __init dynamic_debug_init(void)
 			mod_sites = 0;
 			modname = desc_modname(iter);
 			iter_mod_start = iter;
+			site_mod_start = site;
 		}
 	}
 	di.num_descs = mod_sites;
+	di.num_sites = mod_sites;
 	di.descs = iter_mod_start;
+	di.sites = site_mod_start;
 	ret = ddebug_add_module(&di, modname);
 	if (ret)
 		goto out_err;
-- 
2.41.0



  parent reply	other threads:[~2023-10-12 19:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 19:47 [RFC PATCH 00/10] how to reclaim unneeded vmlinux memory ? Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 01/10] dyndbg: prep to isolate 3 repetetive fields Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 02/10] dyndbg: split __dyndbg_sites section out from __dyndbg Jim Cromie
2023-10-12 19:47 ` Jim Cromie [this message]
2023-10-12 19:47 ` [RFC PATCH 04/10] dyndbg: save _ddebug_site mod,file,func fields into maple-trees Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 05/10] dyndbg: avoid _ddebug.site in ddebug_condense_sites Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 06/10] dyndbg: add site_*() macros to avoid using _ddebug.site Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 07/10] dyndbg: wire in __desc_*() functions Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 08/10] dyndbg: drop _ddebug.site member Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 09/10] dyndbg: add dd_clear_range to prune mtrees Jim Cromie
2023-10-12 19:47 ` [RFC PATCH 10/10] dyndbg: cache the dynamically generated prefixes per callsite Jim Cromie
2023-10-12 19:48 [RFC PATCH 00/10] how to reclaim unneeded vmlinux memory ? Jim Cromie
2023-10-12 19:48 ` [RFC PATCH 03/10] dyndbg: add 2nd cursor pair to init-fn Jim Cromie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231012194711.3288031-4-jim.cromie@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=Liam.Howlett@Oracle.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox