Re: [RFC 1/2] printk/dynamic_debug: Remove cyclic dependency between printk.h and dynamic_debug.h

From: jim . cromie
Date: Wed Jan 12 2022 - 22:39:29 EST


On Wed, Jan 12, 2022 at 5:12 AM Petr Mladek <pmladek@xxxxxxxx> wrote:
>
> On Tue 2022-01-11 17:01:35, Rasmus Villemoes wrote:
> > On 11/01/2022 15.30, Petr Mladek wrote:


> > > static inline int dynamic_debug_exec_queries(const char *query, const char *modname)
> > > {
> > > - pr_warn("kernel not built with CONFIG_DYNAMIC_DEBUG_CORE\n");
> > > + /* Use raw _printk() to avoid cyclic dependency. */
> > > + _printk(KERN_WARNING "kernel not built with CONFIG_DYNAMIC_DEBUG_CORE\n");
> > > return 0;
> > > }
> >
> > And for this one I think the solution is even simpler, as I can't find
> > any in-tree callers. Perhaps just nuke it entirely?
>
> Adding Jim into Cc whether he still has any plans to use this API.
>
> Best Regards,
> Petr

This EXPORT can go.

For the user I envisioned, DRM, Ive done it with a callback
provided by dynamic-debug, which maps bits in __drm_debug,
to calls to ddebug_exec_queries, without the export.

https://lore.kernel.org/lkml/20220107052942.1349447-19-jim.cromie@xxxxxxxxx/

This seems like a narrower/tighter interface,
and readily repeatable for other users, should they emerge.

Id welcome your inputs on the whole patchset.
Rasmus, I extend your Factory macros to add a .class_id
and use them to wrap __drm_dev_dbg etc

thanks