Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] The patch silently removes verbose debug logging (`v2pr_info` and 
`vpr_info`) that was previously emitted when module classmaps were successfully 
attached.
--

commit 6fc0ea29f4f01911b3505de6afab9a84131d7e51
Author: Jim Cromie <[email protected]>

dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module

This patch refactors the subrange filtering of module classmaps by moving
the logic from ddebug_attach_module_classes into a new macro named
dd_set_module_subrange. It also hoists the macro invocation into
ddebug_add_module to apply the filtering closer to initialization.

> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index 4a9b9bc9efc5a..b877f4c6d778e 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
[ ... ]
> -             if (!strcmp(cm->mod_name, dt->info.mod_name)) {
> -                     if (!nc) {
> -                             v2pr_info("start subrange, class[%d]: module:%s 
> base:%d len:%d ty:%d\n",
> -                                       i, cm->mod_name, cm->base, 
> cm->length, cm->map_type);
> -                             dt->info.maps.start = cm;
> -                     }
> -                     nc++;
> -             } else if (nc) {
> -                     /* end of matching classmaps */
> -                     break;
> -             }
> -     }
> -     if (nc) {
> -             dt->info.maps.len = nc;
> -             vpr_info("module:%s attached %d classes\n", dt->info.mod_name, 
> nc);
> -     }
> -}
[ ... ]
> +#define dd_set_module_subrange(_i, _sp, _di, _vec) ({                        
> \
> +     struct _ddebug_info *__di = (_di);                              \
> +     typeof(__di->_vec.start) __start = NULL;                        \
> +     int __nc = 0;                                                   \
> +     for_subvec(_i, _sp, __di, _vec) {                               \
> +             if (!strcmp((_sp)->mod_name, __di->mod_name)) {         \
> +                     if (!__nc++)                                    \
> +                             __start = (_sp);                        \
> +             } else if (__nc) {                                      \
> +                     break; /* end of consecutive matches */         \
> +             }                                                       \
> +     }                                                               \
> +     if (__nc)                                                       \
> +             __di->_vec.start = __start;                             \
> +     __di->_vec.len = __nc;                                          \
> +})

[Severity: Low]
Was the removal of the verbose debug logging intentional?

The replaced ddebug_attach_module_classes function previously emitted
v2pr_info and vpr_info messages when module classmaps were successfully
attached. These diagnostic log messages appear to be completely removed
rather than migrated to the new macro.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=21

Reply via email to