[PATCH 03/63] dyndbg: reword "class unknown," to "class:_UNKNOWN_"

Jim Cromie posted 63 patches 1 year ago
There is a newer version of this series
[PATCH 03/63] dyndbg: reword "class unknown," to "class:_UNKNOWN_"
Posted by Jim Cromie 1 year ago
When a dyndbg classname is unknown to a kernel module (as before
previous patch), the callsite is un-addressable via >control queries.

The control-file displays this condition as "class unknown,"
currently.  That spelling is sub-optimal/too-generic, so change it to
"class:_UNKNOWN_" to loudly announce the erroneous situation, and to
make it exceedingly greppable.

NB: pr_debugs are only alterable via >control, and to protect class'd
debug's from unintended alteration, "class name" must be given to
change them.  Classmaps map known classes to reserved .class_ids (the
1..64 val range per module).

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

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 5a007952f7f2..147540c57154 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -1154,7 +1154,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p)
 		if (class)
 			seq_printf(m, " class:%s", class);
 		else
-			seq_printf(m, " class unknown, _id:%d", dp->class_id);
+			seq_printf(m, " class:_UNKNOWN_ _id:%d", dp->class_id);
 	}
 	seq_putc(m, '\n');
 
-- 
2.48.1
Re: [PATCH 03/63] dyndbg: reword "class unknown," to "class:_UNKNOWN_"
Posted by Louis Chauvet 11 months, 2 weeks ago

Le 25/01/2025 à 07:45, Jim Cromie a écrit :
> When a dyndbg classname is unknown to a kernel module (as before
> previous patch), the callsite is un-addressable via >control queries.
> 
> The control-file displays this condition as "class unknown,"
> currently.  That spelling is sub-optimal/too-generic, so change it to
> "class:_UNKNOWN_" to loudly announce the erroneous situation, and to
> make it exceedingly greppable.
> 
> NB: pr_debugs are only alterable via >control, and to protect class'd
> debug's from unintended alteration, "class name" must be given to
> change them.  Classmaps map known classes to reserved .class_ids (the
> 1..64 val range per module).
> 
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>

> ---
>   lib/dynamic_debug.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index 5a007952f7f2..147540c57154 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -1154,7 +1154,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p)
>   		if (class)
>   			seq_printf(m, " class:%s", class);
>   		else
> -			seq_printf(m, " class unknown, _id:%d", dp->class_id);
> +			seq_printf(m, " class:_UNKNOWN_ _id:%d", dp->class_id);
>   	}
>   	seq_putc(m, '\n');
>   

-- 
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com