[PATCH v2 47/59] drm-dyndbg: add DRM_CLASSMAP_USE to bochs

Jim Cromie posted 59 patches 9 months ago
There is a newer version of this series
[PATCH v2 47/59] drm-dyndbg: add DRM_CLASSMAP_USE to bochs
Posted by Jim Cromie 9 months ago
tiny/bochs has 5 DRM_UT_* debugs, make them controllable when
CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
class'd debugs.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 drivers/gpu/drm/tiny/bochs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
index 8706763af8fb..dbcc8ba70dfa 100644
--- a/drivers/gpu/drm/tiny/bochs.c
+++ b/drivers/gpu/drm/tiny/bochs.c
@@ -59,6 +59,8 @@ static int bochs_modeset = -1;
 static int defx = 1024;
 static int defy = 768;
 
+DRM_CLASSMAP_USE(drm_debug_classes);
+
 module_param_named(modeset, bochs_modeset, int, 0444);
 MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting");
 
-- 
2.49.0
Re: [PATCH v2 47/59] drm-dyndbg: add DRM_CLASSMAP_USE to bochs
Posted by Louis Chauvet 8 months, 4 weeks ago

Le 20/03/2025 à 19:52, Jim Cromie a écrit :
> tiny/bochs has 5 DRM_UT_* debugs, make them controllable when
> CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
> class'd debugs.
> 
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>

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

> ---
>   drivers/gpu/drm/tiny/bochs.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
> index 8706763af8fb..dbcc8ba70dfa 100644
> --- a/drivers/gpu/drm/tiny/bochs.c
> +++ b/drivers/gpu/drm/tiny/bochs.c
> @@ -59,6 +59,8 @@ static int bochs_modeset = -1;
>   static int defx = 1024;
>   static int defy = 768;
>   
> +DRM_CLASSMAP_USE(drm_debug_classes);

Do we need to add it for each driver that use drm_* print macros? Is it 
reasonable to add this directly in drm_print.h, so there is no way to 
miss this call if you use drm_* macros.

>   module_param_named(modeset, bochs_modeset, int, 0444);
>   MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting");
>   

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


Re: [PATCH v2 47/59] drm-dyndbg: add DRM_CLASSMAP_USE to bochs
Posted by jim.cromie@gmail.com 8 months, 4 weeks ago
On Mon, Mar 24, 2025 at 9:03 AM Louis Chauvet <louis.chauvet@bootlin.com> wrote:
>
>
>
> Le 20/03/2025 à 19:52, Jim Cromie a écrit :
> > tiny/bochs has 5 DRM_UT_* debugs, make them controllable when
> > CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has
> > class'd debugs.
> >
> > Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
>
> Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
>
> > ---
> >   drivers/gpu/drm/tiny/bochs.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
> > index 8706763af8fb..dbcc8ba70dfa 100644
> > --- a/drivers/gpu/drm/tiny/bochs.c
> > +++ b/drivers/gpu/drm/tiny/bochs.c
> > @@ -59,6 +59,8 @@ static int bochs_modeset = -1;
> >   static int defx = 1024;
> >   static int defy = 768;
> >
> > +DRM_CLASSMAP_USE(drm_debug_classes);
>
> Do we need to add it for each driver that use drm_* print macros? Is it
> reasonable to add this directly in drm_print.h, so there is no way to
> miss this call if you use drm_* macros.
>

Yes, AFAIK.
Ive tried to invoke declarators from a header,
It never works out.

59/59 was an attempt to do it for everyone, but it falls down...

> >   module_param_named(modeset, bochs_modeset, int, 0444);
> >   MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting");
> >
>
> --
> Louis Chauvet, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>