use printk_ratelimit() inside DRM_DEBUG
PATCH 1/1 use printk_ratelimit() inside DRM_DEBUG
the DRM_DEBUG macro can be called within functions very oftenly triggered, thus generating lots of message load and potentially compromising system
Signed-off-by Glauber de Oliveira Costa <[email protected]>
Signature · 3 lines
Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom"
drivers/char/drm/drmP.h renamed from drivers/char/drm/drmP.h.orig +1 -1
@@ -185,7 +185,7 @@#if DRM_DEBUG_CODE #define DRM_DEBUG(fmt, arg...) \ do { \ - if ( drm_debug ) \ + if ( drm_debug && printk_ratelimit() ) \ printk(KERN_DEBUG \ "[" DRM_NAME ":%s] " fmt , \ __FUNCTION__ , ##arg); \
Quoted 16 lines · On Wed, 1 Nov 2006 10:50:51 -0300 Glauber de Oliveira Costa…
the
DRM_DEBUGmacro can be called within functions very oftenly triggered, thus generating lots of message load and potentially compromising systemSigned-off-by Glauber de Oliveira Costa <[email protected]>Signature · 6 lines
Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom" [drm_debug.patch text/plain (444B)]
drivers/char/drm/drmP.h line 191
Quoted 8 lines
drivers/char/drm/drmP.h renamed from drivers/char/drm/drmP.h.orig +1
-1@@ -185,7 +185,7 @@#if DRM_DEBUG_CODE #define DRM_DEBUG(fmt, arg...) \ do { \ - if ( drm_debug ) \ + if ( drm_debug && printk_ratelimit() ) \ printk(KERN_DEBUG \ "[" DRM_NAME ":%s] " fmt , \ __FUNCTION__ , ##arg); \
DRM_DEBUG() should be disabled in production code, and enabled only when developers are developing stuff. In the latter case, the developer wants to see all the messages.
IOW, don't load the drm module with the `debug' parameter.