[Intel-gfx] [RFC] [Patch] [DRM] :Separate several DRM debug levels
jbarnes at virtuousgeek.org
Wed May 27 08:28:04 PDT 2009
On Fri, 15 May 2009 19:21:40 +1000
Dave Airlie <airlied at gmail.com> wrote:
> > Now all the DRM debug info will be printed if the boot option of
> > "drm.debug=1" is added. Sometimes it is inconvenient. We will get
> > too much unrelated info.
> > This will separate several DRM debug levels and the debug level can
> > be used to print the different debug info. And the debug level is
> > controlled by the module parameter of drm.debug
> > In this patch it is divided into four debug levels;
> > drm_core, drm_driver, drm_kms, drm_mode.
> > At the same time four debug macro definitions are provided.
> > DRM_DEBUG(fmt, args...)
> > DRM_DEBUG_DRIVER(prefix, fmt, args...)
> > DRM_DEBUG_KMS(prefix, fmt, args...)
> > DRM_DEBUG_MODE(prefix, fmt, args...)
> > When the boot option of "drm.debug=1" is added, it will print the
> > debug info using DRM_DEBUG. This is to be compatible with
> > When the boot option of "drm.debug=4" is added, it will print the
> > debug info using DRM_DEBUG_KMS macro definition.
> > When the boot option of "drm.debug=6" is added, it will print the
> > debug info using DRM_DEBUG_KMS and DRM_DEBUG_DRIVE.
> > When the DRM_DEBUG is used, the default prefix is "drm".
> > When the DRM_DEBUG_DRIVER/KMS/MODE is used, we can use the
> > different prefix. For example: When DRM_DEBUG_KMS is used in the
> > drivers/gpu/drm/i915/intel_lvds.c, we can use the "i915_lvds" as
> > the prefix.
> I'm just wondering if we can leverage the kernel debug printing stuff
> for all this, I like the idea of what
> you are trying to do alright, its crazy trying to debug using the
> current single path.
> I'm on holidays so can't review too much, but I'd like to see people
> discuss the kernel debug printing
> system and also the split between debug categories.
Yeah it would be good if the kernel could handle this, but it doesn't
seem like the generic debug code will do what we want. We can enable
debug on a by-module basis or hide things with pr_debug, but I didn't
(in my quick scan) see a way of defining subsystem flags for debug
options. Hopefully I'm wrong though... Yakui, have you looked at
all? Maybe it would be better to make your patches improve the
pr_debug stuff instead, allowing drivers & subsystems to register
different types of debug info (probably with just a bitmask) and filter
things that way.
More information about the Intel-gfx