[RESEND PATCH v6 05/14] drm/print: rename drm_debug* to be more syslog-centric
abhinavk at codeaurora.org
abhinavk at codeaurora.org
Fri Sep 17 18:24:33 UTC 2021
On 2021-07-21 10:55, Sean Paul wrote:
> From: Sean Paul <seanpaul at 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 at chromium.org>
Reviewed-by: Abhinav Kumar <abhinavk at 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);
> }
>
> /*
More information about the dri-devel
mailing list