Skip to contentSkip to conversation

drm: Move debug macros out of drmP.h

PATCH Applied Haneen Mohammed 2 participants 4 messages Oct 18, 2017 – Oct 20, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover drm: Move debug macros out of drmP.h

This patchset move debug macros from drmP.h to drm_print.h and move printing related functions used by the debug macros from drm_drv.[hc] to drm_print.[hc].
In addition, it fixes old comment style.

Changes in v4:
- Move DRM_UT_ debug messaging macros from drmP.h to drm_print.h.

Changes in v3:
- Move debug macros and print functions into drm_print.[hc] instead of introducing drm_debug.[hc].

Haneen Mohammed (2):
drm: Move debug macros out of drmP.h
drm/print: Update old comment style

 drivers/gpu/drm/drm_drv.c   |  47 -----------
 drivers/gpu/drm/drm_print.c |  47 +++++++++++
 include/drm/drmP.h          | 193 +-------------------------------------------
 include/drm/drm_drv.h       |   7 --
 include/drm/drm_print.h     | 192 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 240 insertions(+), 246 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH v4 1/2 drm: Move debug macros out of drmP.h

This patch extract DRM_* debug macros from drmP.h to drm_print.h and move printing related functions used by these macros from drm_drv.[hc] to drm_print.[hc].

---
Changes in v4:
- Move DRM_UT_ debug messaging macros from drmP.h to drm_print.h.

 drivers/gpu/drm/drm_drv.c   |  47 -----------
 drivers/gpu/drm/drm_print.c |  47 +++++++++++
 include/drm/drmP.h          | 193 +-----------------------------------------
 include/drm/drm_drv.h       |   7 --
 include/drm/drm_print.h     | 199 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 247 insertions(+), 246 deletions(-)
drivers/gpu/drm/drm_drv.c +0 -47
index be38ac7..9710c78 100644
@@ -74,53 +74,6 @@ static bool drm_core_init_complete = false;
 
 static struct dentry *drm_debugfs_root;
 
-#define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
-
-void drm_dev_printk(const struct device *dev, const char *level,
-		    unsigned int category, const char *function_name,
-		    const char *prefix, const char *format, ...)
-{
-	struct va_format vaf;
-	va_list args;
-
-	if (category != DRM_UT_NONE && !(drm_debug & category))
-		return;
-
-	va_start(args, format);
-	vaf.fmt = format;
-	vaf.va = &args;
-
-	if (dev)
-		dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,
-			   &vaf);
-	else
-		printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);
-
-	va_end(args);
-}
-EXPORT_SYMBOL(drm_dev_printk);
-
-void drm_printk(const char *level, unsigned int category,
-		const char *format, ...)
-{
-	struct va_format vaf;
-	va_list args;
-
-	if (category != DRM_UT_NONE && !(drm_debug & category))
-		return;
-
-	va_start(args, format);
-	vaf.fmt = format;
-	vaf.va = &args;
-
-	printk("%s" "[" DRM_NAME ":%ps]%s %pV",
-	       level, __builtin_return_address(0),
-	       strcmp(level, KERN_ERR) == 0 ? " *ERROR*" : "", &vaf);
-
-	va_end(args);
-}
-EXPORT_SYMBOL(drm_printk);
-
 /*
  * DRM Minors
  * A DRM device can provide several char-dev interfaces on the DRM-Major. Each
drivers/gpu/drm/drm_print.c +47 -0

50 lines not on this page · raw message

include/drm/drmP.h +1 -192

215 lines not on this page · raw message

include/drm/drm_drv.h +0 -7
index 71bbaae..4f3cc25 100644
@@ -592,13 +592,6 @@ struct drm_driver {
 	int dev_priv_size;
 };
 
-__printf(6, 7)
-void drm_dev_printk(const struct device *dev, const char *level,
-		    unsigned int category, const char *function_name,
-		    const char *prefix, const char *format, ...);
-__printf(3, 4)
-void drm_printk(const char *level, unsigned int category,
-		const char *format, ...);
 extern unsigned int drm_debug;
 
 int drm_dev_init(struct drm_device *dev,
include/drm/drm_print.h +199 -0

203 lines not on this page · raw message

Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH v4 2/2 drm/print: Update old comment style

In reply to Haneen Mohammed

Remove old comment style used by doxygen.
And remove comment left from commit 99cdb35e787b ("drm/doc: move printf helpers out of drmP.h") after refactoring drmP.h.

---
Changes in v4:
- Nothing.

 include/drm/drm_print.h | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)
include/drm/drm_print.h +10 -17
index 41dd757..7b9c86a 100644
@@ -179,9 +179,8 @@ void drm_dev_printk(const struct device *dev, const char *level,
 __printf(3, 4)
 void drm_printk(const char *level, unsigned int category,
 		const char *format, ...);
-/***********************************************************************/
-/** \name Macros to make printk easier */
-/*@{*/
+
+/* Macros to make printk easier */
 
 #define _DRM_PRINTK(once, level, fmt, ...)				\
 	do {								\
@@ -206,8 +205,8 @@ void drm_printk(const char *level, unsigned int category,
 /**
  * Error output.
  *
- * \param fmt printf() like format string.
- * \param arg arguments
+ * @dev: device pointer
+ * @fmt: printf() like format string.
  */
 #define DRM_DEV_ERROR(dev, fmt, ...)					\
 	drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, __func__, " *ERROR*",\
@@ -218,8 +217,8 @@ void drm_printk(const char *level, unsigned int category,
 /**
  * Rate limited error output.  Like DRM_ERROR() but won't flood the log.
  *
- * \param fmt printf() like format string.
- * \param arg arguments
+ * @dev: device pointer
+ * @fmt: printf() like format string.
  */
 #define DRM_DEV_ERROR_RATELIMITED(dev, fmt, ...)			\
 ({									\
@@ -249,8 +248,8 @@ void drm_printk(const char *level, unsigned int category,
 /**
  * Debug output.
  *
- * \param fmt printf() like format string.
- * \param arg arguments
+ * @dev: device pointer
+ * @fmt: printf() like format string.
  */
 #define DRM_DEV_DEBUG(dev, fmt, args...)				\
 	drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, __func__, "", fmt,	\
@@ -301,8 +300,8 @@ void drm_printk(const char *level, unsigned int category,
 /**
  * Rate limited debug output. Like DRM_DEBUG() but won't flood the log.
  *
- * \param fmt printf() like format string.
- * \param arg arguments
+ * @dev: device pointer
+ * @fmt: printf() like format string.
  */
 #define DRM_DEV_DEBUG_RATELIMITED(dev, fmt, args...)			\
 	DEV__DRM_DEFINE_DEBUG_RATELIMITED(dev, CORE, fmt, ##args)
@@ -321,10 +320,4 @@ void drm_printk(const char *level, unsigned int category,
 #define DRM_DEBUG_PRIME_RATELIMITED(fmt, args...)			\
 	DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##args)
 
-/* Format strings and argument splitters to simplify printing
- * various "complex" objects
- */
-
-/*@}*/
-
 #endif /* DRM_PRINT_H_ */
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#3 lore raw
In reply to Haneen Mohammed
Quoted 8 lines · Haneen Mohammed

This patchset move debug macros from drmP.h to drm_print.h and move printing related functions used by the debug macros from drm_drv.[hc] to drm_print.[hc].
In addition, it fixes old comment style.

Changes in v4:
- Move DRM_UT_ debug messaging macros from drmP.h to drm_print.h.

Quoted 7 lines

Changes in v3:
- Move debug macros and print functions into drm_print.[hc] instead of introducing drm_debug.[hc].

Haneen Mohammed (2):
drm: Move debug macros out of drmP.h
drm/print: Update old comment style

Applied to drm-misc-next.

Thanks!

Sean

Quoted 11 lines
 drivers/gpu/drm/drm_drv.c   |  47 -----------
 drivers/gpu/drm/drm_print.c |  47 +++++++++++
 include/drm/drmP.h          | 193 +-------------------------------------------
 include/drm/drm_drv.h       |   7 --
 include/drm/drm_print.h     | 192 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 240 insertions(+), 246 deletions(-)
Signature · 1 line
2.7.4
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel