Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The fallback stub for _dynamic_func_call_cls silently compiles out subsystem debug logs (like DRM) in production kernels when DEBUG is not defined. --
commit 4c2d1161afbd83349da0d51c36ebb02bc49b083c Author: Jim Cromie <[email protected]> dyndbg: add DEBUG-biased fallback stubs for _dynamic_func_call_cls When the dynamic debug core is enabled but global dynamic debug is disabled, subsystems can face build failures due to undefined _dynamic_func_call_cls macros. This commit adds stub definitions that mirror enabled behavior to fix the implicit declarations. When DEBUG is not defined, it uses an if (0) statement to compile out the call while maintaining compile-time checking. Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ > diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h > index 064df695b3a4c..a04e8aeca0004 100644 > --- a/include/linux/dynamic_debug.h > +++ b/include/linux/dynamic_debug.h [ ... ] > @@ -541,6 +541,23 @@ void ddebug_increment_call_count(void); > #define DYNAMIC_DEBUG_BRANCH(descriptor) false > #define DECLARE_DYNDBG_CLASSMAP(...) > > +#if defined(DEBUG) > +#define _dynamic_func_call_cls(cls, fmt, func, ...) \ > + do { func(NULL, ##__VA_ARGS__); } while (0) > +#define _dynamic_func_call_cls_no_desc(cls, fmt, func, ...) \ > + do { func(__VA_ARGS__); } while (0) > +#else > +#define _dynamic_func_call_cls(cls, fmt, func, ...) \ > + do { if (0) func(NULL, ##__VA_ARGS__); } while (0) [Severity: High] Does this unintentionally cause a regression by compiling out subsystem debug logs in production kernels when DEBUG is not defined? For example, DRM wraps its debug functions using this macro in include/drm/drm_print.h: #define drm_dev_dbg(dev, cat, fmt, ...) \ _dynamic_func_call_cls(cat, fmt, __drm_dev_dbg, \ dev, cat, fmt, ##__VA_ARGS__) With the if (0) condition, __drm_dev_dbg() is never executed. Could this bypass subsystem-specific runtime parameter checks like drm.debug and silently disable runtime debug logging capabilities for these subsystems? > +#define _dynamic_func_call_cls_no_desc(cls, fmt, func, ...) \ > + do { if (0) func(__VA_ARGS__); } while (0) > +#endif -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=39
