dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: abhinavk@codeaurora.org
To: Sean Paul <sean@poorly.run>
Cc: dri-devel@lists.freedesktop.org, ppaalanen@gmail.com,
	maarten.lankhorst@linux.intel.com, tzimmermann@suse.de,
	airlied@linux.ie, daniel.vetter@ffwll.ch,
	Sean Paul <seanpaul@chromium.org>
Subject: Re: [RESEND PATCH v6 05/14] drm/print: rename drm_debug* to be more syslog-centric
Date: Fri, 17 Sep 2021 11:24:33 -0700	[thread overview]
Message-ID: <683580039a25b686b39fa35450deb6c3@codeaurora.org> (raw)
In-Reply-To: <20210721175526.22020-6-sean@poorly.run>

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);
>  }
> 
>  /*

  parent reply	other threads:[~2021-09-17 18:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 17:55 [RESEND PATCH v6 00/14] drm/trace: Mirror DRM debug logs to tracefs Sean Paul
2021-07-21 17:55 ` [RESEND PATCH v6 01/14] drm/mipi_dbi: Convert pr_debug calls to DRM_DEBUG_DRIVER Sean Paul
2021-07-28 15:41   ` jim.cromie
2021-07-21 17:55 ` [RESEND PATCH v6 02/14] drm/sil164: Convert dev_printk to drm_dev_dbg Sean Paul
2021-07-28 14:34   ` jim.cromie
2021-07-21 17:55 ` [RESEND PATCH v6 03/14] drm/i915/utils: Replace dev_printk with drm helpers Sean Paul
2021-07-28 14:39   ` jim.cromie
2021-07-21 17:55 ` [RESEND PATCH v6 04/14] drm/msm/dpu: Replace definitions for dpu debug macros Sean Paul
2021-08-05 14:00   ` Dmitry Baryshkov
2021-09-17 18:23   ` [Freedreno] " abhinavk
2021-07-21 17:55 ` [RESEND PATCH v6 05/14] drm/print: rename drm_debug* to be more syslog-centric Sean Paul
2021-07-28 16:03   ` jim.cromie
2021-07-28 16:13   ` jim.cromie
2021-09-17 18:24   ` abhinavk [this message]
2021-09-17 18:25   ` abhinavk
2021-07-21 17:55 ` [RESEND PATCH v6 06/14] drm/amd: Gate i2c transaction logs on drm_debug_syslog Sean Paul
2021-07-21 17:55 ` [RESEND PATCH v6 07/14] drm/etnaviv: Change buffer dump checks to target syslog Sean Paul
2021-07-21 20:54   ` Lucas Stach
2021-07-21 17:55 ` [RESEND PATCH v6 08/14] drm/nouveau: Change debug checks to specifically " Sean Paul
2021-07-21 17:55 ` [RESEND PATCH v6 09/14] drm/i915: Change infoframe debug checks to specify syslog Sean Paul
2021-07-21 17:55 ` [RESEND PATCH v6 10/14] drm/print: Add drm_debug_category_printer Sean Paul
2021-09-17 18:27   ` abhinavk
2021-07-21 17:55 ` [RESEND PATCH v6 11/14] drm/mst: Convert debug printers to debug category printers Sean Paul
2021-07-27 19:25   ` Lyude Paul
2021-07-21 17:55 ` [RESEND PATCH v6 12/14] drm/i915: Use debug category printer for welcome message Sean Paul
2021-07-21 17:55 ` [RESEND PATCH v6 13/14] drm/atomic: Use debug category printer for atomic state printer Sean Paul
2021-09-17 18:27   ` abhinavk
2021-07-21 17:55 ` [RESEND PATCH v6 14/14] drm/print: Add tracefs support to the drm logging helpers Sean Paul
2021-07-26 20:50   ` Rodrigo Siqueira
2021-07-29 20:24   ` jim.cromie
2021-07-29 20:33     ` jim.cromie
2021-09-17 18:17   ` abhinavk
2021-07-22  7:49 ` [RESEND PATCH v6 00/14] drm/trace: Mirror DRM debug logs to tracefs Pekka Paalanen
2021-07-22 13:48   ` Sean Paul
2021-07-22 13:49     ` Sean Paul
2021-07-23  8:02     ` Pekka Paalanen
2021-09-17 17:58 ` abhinavk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=683580039a25b686b39fa35450deb6c3@codeaurora.org \
    --to=abhinavk@codeaurora.org \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=ppaalanen@gmail.com \
    --cc=sean@poorly.run \
    --cc=seanpaul@chromium.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).