diff mbox series

[RESEND,v6,05/14] drm/print: rename drm_debug* to be more syslog-centric

Message ID 20210721175526.22020-6-sean@poorly.run (mailing list archive)
State New, archived
Headers show
Series drm/trace: Mirror DRM debug logs to tracefs | expand

Commit Message

Sean Paul July 21, 2021, 5:55 p.m. UTC
From: Sean Paul <seanpaul@chromium.org>

In preparation for tracefs support, rename drm_debug related functions
to reflect that it targets the syslog. This will allow us to selectively
target syslog and/or tracefs.

No functional changes here.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-6-sean@poorly.run #v5

Changes in v5:
-Added to the set
Changes in v6:
-None
---
 drivers/gpu/drm/drm_print.c | 12 ++++++------
 include/drm/drm_print.h     | 13 +++++++++----
 2 files changed, 15 insertions(+), 10 deletions(-)

Comments

Jim Cromie July 28, 2021, 4:03 p.m. UTC | #1
On Wed, Jul 21, 2021 at 1:55 PM Sean Paul <sean@poorly.run> wrote:
>
> From: Sean Paul <seanpaul@chromium.org>
>
> In preparation for tracefs support, rename drm_debug related functions
> to reflect that it targets the syslog. This will allow us to selectively
> target syslog and/or tracefs.
>
> No functional changes here.

I feel like a fish asking "whats water?"

from a parochial dynamic-debug view, there is only syslog.
(maybe theres also console, I try not to think of the rogue tty gonna eat me)

is there something in the tracefs work that makes this necessary ?
Jim Cromie July 28, 2021, 4:13 p.m. UTC | #2
On Wed, Jul 21, 2021 at 1:55 PM Sean Paul <sean@poorly.run> wrote:
>
> From: Sean Paul <seanpaul@chromium.org>
>
> In preparation for tracefs support, rename drm_debug related functions
> to reflect that it targets the syslog. This will allow us to selectively
> target syslog and/or tracefs.
>
> No functional changes here.
>
...
> +static inline bool drm_debug_syslog_enabled(enum drm_debug_category category)
> +{
> +       return unlikely(__drm_debug_syslog & category);
> +}
> +
>  static inline bool drm_debug_enabled(enum drm_debug_category category)
>  {
> -       return unlikely(__drm_debug & category);
> +       return drm_debug_syslog_enabled(category);
>  }
>


ok so the distinction is  this has 2  drm_debug_enabled() fns,
allowing separate decisions later.

IIUC,  in the long run, @danvet wants 0 of these.
Abhinav Kumar Sept. 17, 2021, 6:24 p.m. UTC | #3
On 2021-07-21 10:55, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> In preparation for tracefs support, rename drm_debug related functions
> to reflect that it targets the syslog. This will allow us to 
> selectively
> target syslog and/or tracefs.
> 
> No functional changes here.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-6-sean@poorly.run
> #v5
> 
> Changes in v5:
> -Added to the set
> Changes in v6:
> -None
> ---
>  drivers/gpu/drm/drm_print.c | 12 ++++++------
>  include/drm/drm_print.h     | 13 +++++++++----
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index 111b932cf2a9..2ff7a6ecc632 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -37,11 +37,11 @@
>  #include <drm/drm_print.h>
> 
>  /*
> - * __drm_debug: Enable debug output.
> + * __drm_debug_syslog: Enable debug output to system logs
>   * Bitmask of DRM_UT_x. See include/drm/drm_print.h for details.
>   */
> -unsigned int __drm_debug;
> -EXPORT_SYMBOL(__drm_debug);
> +unsigned int __drm_debug_syslog;
> +EXPORT_SYMBOL(__drm_debug_syslog);
> 
>  MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables
> a debug category.\n"
>  "\t\tBit 0 (0x01)  will enable CORE messages (drm core code)\n"
> @@ -52,7 +52,7 @@ MODULE_PARM_DESC(debug, "Enable debug output, where
> each bit enables a debug cat
>  "\t\tBit 5 (0x20)  will enable VBL messages (vblank code)\n"
>  "\t\tBit 7 (0x80)  will enable LEASE messages (leasing code)\n"
>  "\t\tBit 8 (0x100) will enable DP messages (displayport code)");
> -module_param_named(debug, __drm_debug, int, 0600);
> +module_param_named(debug, __drm_debug_syslog, int, 0600);
> 
>  void __drm_puts_coredump(struct drm_printer *p, const char *str)
>  {
> @@ -160,11 +160,11 @@ void __drm_printfn_info(struct drm_printer *p,
> struct va_format *vaf)
>  }
>  EXPORT_SYMBOL(__drm_printfn_info);
> 
> -void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf)
> +void __drm_printfn_debug_syslog(struct drm_printer *p, struct 
> va_format *vaf)
>  {
>  	pr_debug("%s %pV", p->prefix, vaf);
>  }
> -EXPORT_SYMBOL(__drm_printfn_debug);
> +EXPORT_SYMBOL(__drm_printfn_debug_syslog);
> 
>  void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf)
>  {
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 9b66be54dd16..2ea0ffd9c1ce 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -35,7 +35,7 @@
>  #include <drm/drm.h>
> 
>  /* Do *not* use outside of drm_print.[ch]! */
> -extern unsigned int __drm_debug;
> +extern unsigned int __drm_debug_syslog;
> 
>  /**
>   * DOC: print
> @@ -85,7 +85,7 @@ void __drm_puts_coredump(struct drm_printer *p,
> const char *str);
>  void __drm_printfn_seq_file(struct drm_printer *p, struct va_format 
> *vaf);
>  void __drm_puts_seq_file(struct drm_printer *p, const char *str);
>  void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
> -void __drm_printfn_debug(struct drm_printer *p, struct va_format 
> *vaf);
> +void __drm_printfn_debug_syslog(struct drm_printer *p, struct 
> va_format *vaf);
>  void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf);
> 
>  __printf(2, 3)
> @@ -227,7 +227,7 @@ static inline struct drm_printer
> drm_info_printer(struct device *dev)
>  static inline struct drm_printer drm_debug_printer(const char *prefix)
>  {
>  	struct drm_printer p = {
> -		.printfn = __drm_printfn_debug,
> +		.printfn = __drm_printfn_debug_syslog,
>  		.prefix = prefix
>  	};
>  	return p;
> @@ -319,9 +319,14 @@ enum drm_debug_category {
>  	DRM_UT_DRMRES		= 0x200,
>  };
> 
> +static inline bool drm_debug_syslog_enabled(enum drm_debug_category 
> category)
> +{
> +	return unlikely(__drm_debug_syslog & category);
> +}
> +
>  static inline bool drm_debug_enabled(enum drm_debug_category category)
>  {
> -	return unlikely(__drm_debug & category);
> +	return drm_debug_syslog_enabled(category);
>  }
> 
>  /*
Abhinav Kumar Sept. 17, 2021, 6:25 p.m. UTC | #4
On 2021-07-21 10:55, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> In preparation for tracefs support, rename drm_debug related functions
> to reflect that it targets the syslog. This will allow us to 
> selectively
> target syslog and/or tracefs.
> 
> No functional changes here.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-6-sean@poorly.run
> #v5
> 
> Changes in v5:
> -Added to the set
> Changes in v6:
> -None
> ---
>  drivers/gpu/drm/drm_print.c | 12 ++++++------
>  include/drm/drm_print.h     | 13 +++++++++----
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index 111b932cf2a9..2ff7a6ecc632 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -37,11 +37,11 @@
>  #include <drm/drm_print.h>
> 
>  /*
> - * __drm_debug: Enable debug output.
> + * __drm_debug_syslog: Enable debug output to system logs
>   * Bitmask of DRM_UT_x. See include/drm/drm_print.h for details.
>   */
> -unsigned int __drm_debug;
> -EXPORT_SYMBOL(__drm_debug);
> +unsigned int __drm_debug_syslog;
> +EXPORT_SYMBOL(__drm_debug_syslog);
> 
>  MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables
> a debug category.\n"
>  "\t\tBit 0 (0x01)  will enable CORE messages (drm core code)\n"
> @@ -52,7 +52,7 @@ MODULE_PARM_DESC(debug, "Enable debug output, where
> each bit enables a debug cat
>  "\t\tBit 5 (0x20)  will enable VBL messages (vblank code)\n"
>  "\t\tBit 7 (0x80)  will enable LEASE messages (leasing code)\n"
>  "\t\tBit 8 (0x100) will enable DP messages (displayport code)");
> -module_param_named(debug, __drm_debug, int, 0600);
> +module_param_named(debug, __drm_debug_syslog, int, 0600);
> 
>  void __drm_puts_coredump(struct drm_printer *p, const char *str)
>  {
> @@ -160,11 +160,11 @@ void __drm_printfn_info(struct drm_printer *p,
> struct va_format *vaf)
>  }
>  EXPORT_SYMBOL(__drm_printfn_info);
> 
> -void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf)
> +void __drm_printfn_debug_syslog(struct drm_printer *p, struct 
> va_format *vaf)
>  {
>  	pr_debug("%s %pV", p->prefix, vaf);
>  }
> -EXPORT_SYMBOL(__drm_printfn_debug);
> +EXPORT_SYMBOL(__drm_printfn_debug_syslog);
> 
>  void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf)
>  {
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 9b66be54dd16..2ea0ffd9c1ce 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -35,7 +35,7 @@
>  #include <drm/drm.h>
> 
>  /* Do *not* use outside of drm_print.[ch]! */
> -extern unsigned int __drm_debug;
> +extern unsigned int __drm_debug_syslog;
> 
>  /**
>   * DOC: print
> @@ -85,7 +85,7 @@ void __drm_puts_coredump(struct drm_printer *p,
> const char *str);
>  void __drm_printfn_seq_file(struct drm_printer *p, struct va_format 
> *vaf);
>  void __drm_puts_seq_file(struct drm_printer *p, const char *str);
>  void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
> -void __drm_printfn_debug(struct drm_printer *p, struct va_format 
> *vaf);
> +void __drm_printfn_debug_syslog(struct drm_printer *p, struct 
> va_format *vaf);
>  void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf);
> 
>  __printf(2, 3)
> @@ -227,7 +227,7 @@ static inline struct drm_printer
> drm_info_printer(struct device *dev)
>  static inline struct drm_printer drm_debug_printer(const char *prefix)
>  {
>  	struct drm_printer p = {
> -		.printfn = __drm_printfn_debug,
> +		.printfn = __drm_printfn_debug_syslog,
>  		.prefix = prefix
>  	};
>  	return p;
> @@ -319,9 +319,14 @@ enum drm_debug_category {
>  	DRM_UT_DRMRES		= 0x200,
>  };
> 
> +static inline bool drm_debug_syslog_enabled(enum drm_debug_category 
> category)
> +{
> +	return unlikely(__drm_debug_syslog & category);
> +}
> +
>  static inline bool drm_debug_enabled(enum drm_debug_category category)
>  {
> -	return unlikely(__drm_debug & category);
> +	return drm_debug_syslog_enabled(category);
>  }
> 
>  /*
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 111b932cf2a9..2ff7a6ecc632 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -37,11 +37,11 @@ 
 #include <drm/drm_print.h>
 
 /*
- * __drm_debug: Enable debug output.
+ * __drm_debug_syslog: Enable debug output to system logs
  * Bitmask of DRM_UT_x. See include/drm/drm_print.h for details.
  */
-unsigned int __drm_debug;
-EXPORT_SYMBOL(__drm_debug);
+unsigned int __drm_debug_syslog;
+EXPORT_SYMBOL(__drm_debug_syslog);
 
 MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n"
 "\t\tBit 0 (0x01)  will enable CORE messages (drm core code)\n"
@@ -52,7 +52,7 @@  MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug cat
 "\t\tBit 5 (0x20)  will enable VBL messages (vblank code)\n"
 "\t\tBit 7 (0x80)  will enable LEASE messages (leasing code)\n"
 "\t\tBit 8 (0x100) will enable DP messages (displayport code)");
-module_param_named(debug, __drm_debug, int, 0600);
+module_param_named(debug, __drm_debug_syslog, int, 0600);
 
 void __drm_puts_coredump(struct drm_printer *p, const char *str)
 {
@@ -160,11 +160,11 @@  void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf)
 }
 EXPORT_SYMBOL(__drm_printfn_info);
 
-void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf)
+void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf)
 {
 	pr_debug("%s %pV", p->prefix, vaf);
 }
-EXPORT_SYMBOL(__drm_printfn_debug);
+EXPORT_SYMBOL(__drm_printfn_debug_syslog);
 
 void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf)
 {
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 9b66be54dd16..2ea0ffd9c1ce 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -35,7 +35,7 @@ 
 #include <drm/drm.h>
 
 /* Do *not* use outside of drm_print.[ch]! */
-extern unsigned int __drm_debug;
+extern unsigned int __drm_debug_syslog;
 
 /**
  * DOC: print
@@ -85,7 +85,7 @@  void __drm_puts_coredump(struct drm_printer *p, const char *str);
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
 void __drm_puts_seq_file(struct drm_printer *p, const char *str);
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
-void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
+void __drm_printfn_debug_syslog(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf);
 
 __printf(2, 3)
@@ -227,7 +227,7 @@  static inline struct drm_printer drm_info_printer(struct device *dev)
 static inline struct drm_printer drm_debug_printer(const char *prefix)
 {
 	struct drm_printer p = {
-		.printfn = __drm_printfn_debug,
+		.printfn = __drm_printfn_debug_syslog,
 		.prefix = prefix
 	};
 	return p;
@@ -319,9 +319,14 @@  enum drm_debug_category {
 	DRM_UT_DRMRES		= 0x200,
 };
 
+static inline bool drm_debug_syslog_enabled(enum drm_debug_category category)
+{
+	return unlikely(__drm_debug_syslog & category);
+}
+
 static inline bool drm_debug_enabled(enum drm_debug_category category)
 {
-	return unlikely(__drm_debug & category);
+	return drm_debug_syslog_enabled(category);
 }
 
 /*