[PATCH] drm: move a few frequent traces to DRM_VERB()

Rob Clark rob.clark at linaro.org
Mon Oct 8 12:23:38 PDT 2012


From: Rob Clark <rob at ti.com>

Add a new bit for the trace-mask for verbose traces.

Signed-off-by: Rob Clark <rob at ti.com>
---
 drivers/gpu/drm/drm_drv.c |    9 +++++++--
 drivers/gpu/drm/drm_vm.c  |    4 ++--
 include/drm/drmP.h        |    9 ++++++++-
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 933e7ae..b31296f 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -394,7 +394,7 @@ long drm_ioctl(struct file *filp,
 	atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]);
 	++file_priv->ioctl_count;
 
-	DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
+	DRM_VERB("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
 		  task_pid_nr(current), cmd, nr,
 		  (long)old_encode_dev(file_priv->minor->device),
 		  file_priv->authenticated);
@@ -475,8 +475,13 @@ long drm_ioctl(struct file *filp,
 	if (kdata != stack_kdata)
 		kfree(kdata);
 	atomic_dec(&dev->ioctl_count);
-	if (retcode)
+	if (retcode) {
+		DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
+			  task_pid_nr(current), cmd, nr,
+			  (long)old_encode_dev(file_priv->minor->device),
+			  file_priv->authenticated);
 		DRM_DEBUG("ret = %d\n", retcode);
+	}
 	return retcode;
 }
 
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 961ee08..0a6ff73 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -411,7 +411,7 @@ void drm_vm_open_locked(struct drm_device *dev,
 {
 	struct drm_vma_entry *vma_entry;
 
-	DRM_DEBUG("0x%08lx,0x%08lx\n",
+	DRM_VERB("0x%08lx,0x%08lx\n",
 		  vma->vm_start, vma->vm_end - vma->vm_start);
 	atomic_inc(&dev->vma_count);
 
@@ -438,7 +438,7 @@ void drm_vm_close_locked(struct drm_device *dev,
 {
 	struct drm_vma_entry *pt, *temp;
 
-	DRM_DEBUG("0x%08lx,0x%08lx\n",
+	DRM_VERB("0x%08lx,0x%08lx\n",
 		  vma->vm_start, vma->vm_end - vma->vm_start);
 	atomic_dec(&dev->vma_count);
 
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index f719c4d..b472114 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -92,6 +92,8 @@ struct drm_device;
 #define DRM_UT_DRIVER		0x02
 #define DRM_UT_KMS		0x04
 #define DRM_UT_PRIME		0x08
+#define DRM_UT_CORE_VERB	0x10
+
 /*
  * Three debug levels are defined.
  * drm_core, drm_driver, drm_kms
@@ -206,7 +208,11 @@ int drm_err(const char *func, const char *format, ...);
 		drm_ut_debug_printk(DRM_UT_CORE, DRM_NAME, 		\
 					__func__, fmt, ##args);		\
 	} while (0)
-
+#define DRM_VERB(fmt, args...)						\
+	do {								\
+		drm_ut_debug_printk(DRM_UT_CORE_VERB, DRM_NAME,		\
+					__func__, fmt, ##args);		\
+	} while (0)
 #define DRM_DEBUG_DRIVER(fmt, args...)					\
 	do {								\
 		drm_ut_debug_printk(DRM_UT_DRIVER, DRM_NAME,		\
@@ -247,6 +253,7 @@ int drm_err(const char *func, const char *format, ...);
 #define DRM_DEBUG_KMS(fmt, args...)	do { } while (0)
 #define DRM_DEBUG_PRIME(fmt, args...)	do { } while (0)
 #define DRM_DEBUG(fmt, arg...)		 do { } while (0)
+#define DRM_VERB(fmt, arg...)		 do { } while (0)
 #define DRM_LOG(fmt, arg...)		do { } while (0)
 #define DRM_LOG_KMS(fmt, args...) do { } while (0)
 #define DRM_LOG_MODE(fmt, arg...) do { } while (0)
-- 
1.7.9.5



More information about the dri-devel mailing list