Message ID | 20220904214134.408619-40-jim.cromie@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | DYNDBG: opt-in class'd debug for modules, use in drm. | expand |
On Sun, Sep 04, 2022 at 03:41:16PM -0600, Jim Cromie wrote: > clone DRM.debug interface to DRM.tracebits: ie map bits to > drm-debug-categories, except this interface enables messages to > tracefs, not to syslog. > > 1- we reuse the class-map added previously. > this reflects the single source of both syslog/trace events > > 2- add a 2nd struct ddebug_classes_bitmap_param > refs 1, reusing it. > flags = "T", to enable trace-events on this callsite. > > 3- module_param_cb([2]) - does the sysfs part > > Signed-off-by: Jim Cromie <jim.cromie@gmail.com> All the drm patches (excluding nouveau) I haven't commented on: Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> I think nouveau I'll leave up to nouveau folks. -Daniel > --- > drivers/gpu/drm/drm_print.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c > index c50edbf443d3..75d0cecd7e86 100644 > --- a/drivers/gpu/drm/drm_print.c > +++ b/drivers/gpu/drm/drm_print.c > @@ -45,6 +45,9 @@ > unsigned long __drm_debug; > EXPORT_SYMBOL(__drm_debug); > > +unsigned long __drm_trace; > +EXPORT_SYMBOL(__drm_trace); > + > MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" > "\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" > "\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" > @@ -77,6 +80,13 @@ static struct ddebug_class_param drm_debug_bitmap = { > .map = &drm_debug_classes, > }; > module_param_cb(debug, ¶m_ops_dyndbg_classes, &drm_debug_bitmap, 0600); > + > +static struct ddebug_class_param drm_trace_bitmap = { > + .bits = &__drm_trace, > + .flags = "T", > + .map = &drm_debug_classes, > +}; > +module_param_cb(tracecats, ¶m_ops_dyndbg_classes, &drm_trace_bitmap, 0600); > #endif > > void __drm_puts_coredump(struct drm_printer *p, const char *str) > -- > 2.37.2 >
diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index c50edbf443d3..75d0cecd7e86 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -45,6 +45,9 @@ unsigned long __drm_debug; EXPORT_SYMBOL(__drm_debug); +unsigned long __drm_trace; +EXPORT_SYMBOL(__drm_trace); + MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" "\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" "\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" @@ -77,6 +80,13 @@ static struct ddebug_class_param drm_debug_bitmap = { .map = &drm_debug_classes, }; module_param_cb(debug, ¶m_ops_dyndbg_classes, &drm_debug_bitmap, 0600); + +static struct ddebug_class_param drm_trace_bitmap = { + .bits = &__drm_trace, + .flags = "T", + .map = &drm_debug_classes, +}; +module_param_cb(tracecats, ¶m_ops_dyndbg_classes, &drm_trace_bitmap, 0600); #endif void __drm_puts_coredump(struct drm_printer *p, const char *str)
clone DRM.debug interface to DRM.tracebits: ie map bits to drm-debug-categories, except this interface enables messages to tracefs, not to syslog. 1- we reuse the class-map added previously. this reflects the single source of both syslog/trace events 2- add a 2nd struct ddebug_classes_bitmap_param refs 1, reusing it. flags = "T", to enable trace-events on this callsite. 3- module_param_cb([2]) - does the sysfs part Signed-off-by: Jim Cromie <jim.cromie@gmail.com> --- drivers/gpu/drm/drm_print.c | 10 ++++++++++ 1 file changed, 10 insertions(+)