public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use printk_ratelimit() inside DRM_DEBUG
@ 2006-11-01 13:50 Glauber de Oliveira Costa
  2006-11-01 20:06 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Glauber de Oliveira Costa @ 2006-11-01 13:50 UTC (permalink / raw)
  To: dri-devel, airlied, linux-kernel, akpm

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

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 <gcosta@redhat.com>

-- 
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"

[-- Attachment #2: drm_debug.patch --]
[-- Type: text/plain, Size: 443 bytes --]

--- linux-2.6.18.x86_64/drivers/char/drm/drmP.h.orig	2006-11-01 08:00:18.000000000 -0500
+++ linux-2.6.18.x86_64/drivers/char/drm/drmP.h	2006-11-01 08:06:27.000000000 -0500
@@ -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);			\

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] use printk_ratelimit() inside DRM_DEBUG
  2006-11-01 13:50 [PATCH] use printk_ratelimit() inside DRM_DEBUG Glauber de Oliveira Costa
@ 2006-11-01 20:06 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2006-11-01 20:06 UTC (permalink / raw)
  To: Glauber de Oliveira Costa; +Cc: dri-devel, airlied, linux-kernel

On Wed, 1 Nov 2006 10:50:51 -0300
Glauber de Oliveira Costa <gcosta@redhat.com> wrote:

> 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 <gcosta@redhat.com>
> 
> -- 
> Glauber de Oliveira Costa
> Red Hat Inc.
> "Free as in Freedom"
> 
> 
> [drm_debug.patch  text/plain (444B)]
> --- linux-2.6.18.x86_64/drivers/char/drm/drmP.h.orig	2006-11-01 08:00:18.000000000 -0500
> +++ linux-2.6.18.x86_64/drivers/char/drm/drmP.h	2006-11-01 08:06:27.000000000 -0500
> @@ -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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-01 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-01 13:50 [PATCH] use printk_ratelimit() inside DRM_DEBUG Glauber de Oliveira Costa
2006-11-01 20:06 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox