[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231012194834.3288085-7-jim.cromie@gmail.com>
Date: Thu, 12 Oct 2023 13:48:30 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: linux-kernel@...r.kernel.org, jbaron@...mai.com,
gregkh@...uxfoundation.org
Cc: david@...hat.com, lb@...ihalf.com, linux@...musvillemoes.dk,
joe@...ches.com, mcgrof@...nel.org, Liam.Howlett@...cle.com,
linux-mm@...ck.org, Jim Cromie <jim.cromie@...il.com>
Subject: [RFC PATCH 06/10] dyndbg: add site_*() macros to avoid using _ddebug.site
adjust ddebug_condense_sites() and dynamic_debug_init() to replace
desc_*() uses with new site_*() macros which avoid the _ddebug.site
pointers by relying upon site* cursors instead.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
lib/dynamic_debug.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 563d373224ba..48564625a37e 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -1426,6 +1426,9 @@ static void dd_store_range(struct maple_tree *mt, const struct _ddebug *start,
v4pr_info(" ok %s at %lx\n", val, first);
}
+#define site_function(s) (s)->_function
+#define site_filename(s) (s)->_filename
+#define site_modname(s) (s)->_modname
static void ddebug_condense_sites(struct _ddebug_info *di)
{
@@ -1440,27 +1443,27 @@ static void ddebug_condense_sites(struct _ddebug_info *di)
BUG_ON(site_function(cur_ds) != desc_function(cur_dd));
- if (!strcmp(desc_function(cur_dd), desc_function(func_dd)))
+ if (!strcmp(site_function(cur_ds), site_function(func_ds)))
continue;
- dd_store_range(&mt_funcs, func_dd, cur_dd, "func", desc_function(func_dd));
+ dd_store_range(&mt_funcs, func_dd, cur_dd, "func", site_function(func_ds));
func_dd = cur_dd;
func_ds = cur_ds;
- if (!strcmp(desc_filename(cur_dd), desc_filename(file_dd)))
+ if (!strcmp(site_filename(cur_ds), site_filename(file_ds)))
continue;
- dd_store_range(&mt_files, file_dd, cur_dd, "file", desc_filename(file_dd));
+ dd_store_range(&mt_files, file_dd, cur_dd, "file", site_filename(file_ds));
file_dd = cur_dd;
file_ds = cur_ds;
- if (!strcmp(desc_modname(cur_dd), desc_modname(mod_dd)))
+ if (!strcmp(site_modname(cur_ds), site_modname(mod_ds)))
continue;
- dd_store_range(&mt_mods, mod_dd, cur_dd, "mod", desc_modname(mod_dd));
+ dd_store_range(&mt_mods, mod_dd, cur_dd, "mod", site_modname(mod_ds));
mod_dd = cur_dd;
mod_ds = cur_ds;
}
- dd_store_range(&mt_funcs, func_dd, cur_dd, "func:", desc_function(func_dd));
- dd_store_range(&mt_files, file_dd, cur_dd, "file:", desc_filename(file_dd));
- dd_store_range(&mt_mods, mod_dd, cur_dd, "mod:", desc_modname(mod_dd));
+ dd_store_range(&mt_funcs, func_dd, cur_dd, "func:", site_function(func_ds));
+ dd_store_range(&mt_files, file_dd, cur_dd, "file:", site_filename(file_ds));
+ dd_store_range(&mt_mods, mod_dd, cur_dd, "mod:", site_modname(mod_ds));
}
/*
@@ -1688,13 +1691,13 @@ static int __init dynamic_debug_init(void)
}
site = site_mod_start = di.sites;
- iter = iter_mod_start = __start___dyndbg;
- modname = desc_modname(iter);
+ iter = iter_mod_start = di.descs;
+ modname = site_modname(site);
i = mod_sites = mod_ct = 0;
for (; iter < __stop___dyndbg; iter++, site++, i++, mod_sites++) {
- if (strcmp(modname, desc_modname(iter))) {
+ if (strcmp(modname, site_modname(site))) {
mod_ct++;
di.num_descs = mod_sites;
di.num_sites = mod_sites;
@@ -1705,7 +1708,7 @@ static int __init dynamic_debug_init(void)
goto out_err;
mod_sites = 0;
- modname = desc_modname(iter);
+ modname = site_modname(site);
iter_mod_start = iter;
site_mod_start = site;
}
--
2.41.0
Powered by blists - more mailing lists