All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled
@ 2018-12-05 16:56 ` Michel Dänzer
  0 siblings, 0 replies; 42+ messages in thread
From: Michel Dänzer @ 2018-12-05 16:56 UTC (permalink / raw)
  To: Christian Koenig, Huang Rui, Junwei Zhang, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, David Airlie
  Cc: dri-devel, linux-kernel

From: Michel Dänzer <michel.daenzer@amd.com>

The following cases are possible for pr_debug():

1. CONFIG_DYNAMIC_DEBUG disabled
   a) DEBUG not defined: pr_debug() translates to no_printk(...), i.e.
      it never generates any output.
   b) DEBUG defined: pr_debug() translates to printk(KERN_DEBUG ...),
      i.e. it generates output which doesn't appear in dmesg by default,
      can be enabled dynamically.

2. CONFIG_DYNAMIC_DEBUG enabled: pr_debug() translates to
   dynamic_pr_debug()
   a) DEBUG not defined: dynamic_pr_debug() generates no output by
      default, can be enabled dynamically.
   b) DEBUG defined: dynamic_pr_debug() generates output by default,
      can be disabled dynamically.

The intention for drm_debug_printer() is to generate output which
doesn't appear in dmesg by default, but can be enabled dynamically, i.e.
cases 1b) and 2a). However, defining DEBUG unconditionally gave us 2b)
instead of 2a) with CONFIG_DYNAMIC_DEBUG enabled.

Fixes: 79a5ad2fdb3c ("drm: Enable pr_debug() for drm_printer")
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/gpu/drm/drm_print.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 0e7fc3e7dfb4..ee56e4a1b343 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -23,11 +23,13 @@
  * Rob Clark <robdclark@gmail.com>
  */
 
-#define DEBUG /* for pr_debug() */
-
 #include <stdarg.h>
 #include <linux/seq_file.h>
 #include <drm/drmP.h>
+
+#ifndef CONFIG_DYNAMIC_DEBUG
+#define DEBUG /* for pr_debug() */
+#endif
 #include <drm/drm_print.h>
 
 void __drm_puts_coredump(struct drm_printer *p, const char *str)
-- 
2.20.0.rc2


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

end of thread, other threads:[~2018-12-06 17:28 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 16:56 [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled Michel Dänzer
2018-12-05 16:56 ` Michel Dänzer
2018-12-05 16:56 ` [PATCH 2/2] drm/ttm: Use pr_debug for all output from ttm_bo_evict Michel Dänzer
2018-12-05 16:56   ` Michel Dänzer
2018-12-06  2:43   ` Zhang, Jerry(Junwei)
2018-12-06  2:43     ` Zhang, Jerry(Junwei)
2018-12-06  9:09     ` Michel Dänzer
2018-12-06  9:09       ` Michel Dänzer
2018-12-06  9:33       ` Koenig, Christian
2018-12-06  9:33         ` Koenig, Christian
2018-12-06  9:38         ` Michel Dänzer
2018-12-06  9:38           ` Michel Dänzer
2018-12-06  9:50           ` Michel Dänzer
2018-12-06  9:39         ` Zhang, Jerry(Junwei)
2018-12-06  9:39           ` Zhang, Jerry(Junwei)
2018-12-06  9:49           ` Christian König
2018-12-06  9:49             ` Christian König
2018-12-06  9:54             ` Michel Dänzer
2018-12-06  9:54               ` Michel Dänzer
2018-12-06 16:46           ` Joe Perches
2018-12-06 17:28             ` Michel Dänzer
2018-12-06 17:28               ` Michel Dänzer
2018-12-06  2:40 ` [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled Zhang, Jerry(Junwei)
2018-12-06  2:40   ` Zhang, Jerry(Junwei)
2018-12-06  2:51   ` Joe Perches
2018-12-06  9:23     ` Michel Dänzer
2018-12-06 11:41       ` Joe Perches
2018-12-06 11:52         ` Michel Dänzer
2018-12-06 11:52           ` Michel Dänzer
2018-12-06 12:23           ` Joe Perches
2018-12-06 14:41             ` Michel Dänzer
2018-12-06 14:41               ` Michel Dänzer
2018-12-06 16:10               ` Daniel Thompson
2018-12-06 16:10                 ` Daniel Thompson
2018-12-06 16:14                 ` Michel Dänzer
2018-12-06 16:14                   ` Michel Dänzer
2018-12-06 16:22               ` Joe Perches
2018-12-06  9:12   ` Chris Wilson
2018-12-06  9:12     ` Chris Wilson
2018-12-06  9:21     ` Michel Dänzer
2018-12-06  9:28       ` Chris Wilson
2018-12-06  9:28         ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.