From: Luca Coelho <luca@coelho.fi>
To: Jani Nikula <jani.nikula@intel.com>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 02/10] drm/print: move enum drm_debug_category etc. earlier in drm_print.h
Date: Tue, 30 Jan 2024 12:11:36 +0200 [thread overview]
Message-ID: <af97f8a21816578b32c3be96ea5f50eea6fc8a1b.camel@coelho.fi> (raw)
In-Reply-To: <9d105014e3c90af13a874745d768212347f68283.1705410327.git.jani.nikula@intel.com>
On Tue, 2024-01-16 at 15:07 +0200, Jani Nikula wrote:
> Avoid forward declarations in subsequent changes, but separate this
> movement to an independent change.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> include/drm/drm_print.h | 190 ++++++++++++++++++++--------------------
> 1 file changed, 95 insertions(+), 95 deletions(-)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 1040213d02a4..b8b4cb9bb878 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -69,6 +69,101 @@ extern unsigned long __drm_debug;
> * }
> */
>
> +/**
> + * enum drm_debug_category - The DRM debug categories
> + *
> + * Each of the DRM debug logging macros use a specific category, and the logging
> + * is filtered by the drm.debug module parameter. This enum specifies the values
> + * for the interface.
> + *
> + * Each DRM_DEBUG_<CATEGORY> macro logs to DRM_UT_<CATEGORY> category, except
> + * DRM_DEBUG() logs to DRM_UT_CORE.
> + *
> + * Enabling verbose debug messages is done through the drm.debug parameter, each
> + * category being enabled by a bit:
> + *
> + * - drm.debug=0x1 will enable CORE messages
> + * - drm.debug=0x2 will enable DRIVER messages
> + * - drm.debug=0x3 will enable CORE and DRIVER messages
> + * - ...
> + * - drm.debug=0x1ff will enable all messages
> + *
> + * An interesting feature is that it's possible to enable verbose logging at
> + * run-time by echoing the debug value in its sysfs node::
> + *
> + * # echo 0xf > /sys/module/drm/parameters/debug
> + *
> + */
> +enum drm_debug_category {
> + /* These names must match those in DYNAMIC_DEBUG_CLASSBITS */
> + /**
> + * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c,
> + * drm_memory.c, ...
> + */
> + DRM_UT_CORE,
> + /**
> + * @DRM_UT_DRIVER: Used in the vendor specific part of the driver: i915,
> + * radeon, ... macro.
> + */
> + DRM_UT_DRIVER,
> + /**
> + * @DRM_UT_KMS: Used in the modesetting code.
> + */
> + DRM_UT_KMS,
> + /**
> + * @DRM_UT_PRIME: Used in the prime code.
> + */
> + DRM_UT_PRIME,
> + /**
> + * @DRM_UT_ATOMIC: Used in the atomic code.
> + */
> + DRM_UT_ATOMIC,
> + /**
> + * @DRM_UT_VBL: Used for verbose debug message in the vblank code.
> + */
> + DRM_UT_VBL,
> + /**
> + * @DRM_UT_STATE: Used for verbose atomic state debugging.
> + */
> + DRM_UT_STATE,
> + /**
> + * @DRM_UT_LEASE: Used in the lease code.
> + */
> + DRM_UT_LEASE,
> + /**
> + * @DRM_UT_DP: Used in the DP code.
> + */
> + DRM_UT_DP,
> + /**
> + * @DRM_UT_DRMRES: Used in the drm managed resources code.
> + */
> + DRM_UT_DRMRES
> +};
> +
> +static inline bool drm_debug_enabled_raw(enum drm_debug_category category)
> +{
> + return unlikely(__drm_debug & BIT(category));
> +}
> +
> +#define drm_debug_enabled_instrumented(category) \
> + ({ \
> + pr_debug("todo: is this frequent enough to optimize ?\n"); \
> + drm_debug_enabled_raw(category); \
> + })
> +
> +#if defined(CONFIG_DRM_USE_DYNAMIC_DEBUG)
> +/*
> + * the drm.debug API uses dyndbg, so each drm_*dbg macro/callsite gets
> + * a descriptor, and only enabled callsites are reachable. They use
> + * the private macro to avoid re-testing the enable-bit.
> + */
> +#define __drm_debug_enabled(category) true
> +#define drm_debug_enabled(category) drm_debug_enabled_instrumented(category)
> +#else
> +#define __drm_debug_enabled(category) drm_debug_enabled_raw(category)
> +#define drm_debug_enabled(category) drm_debug_enabled_raw(category)
> +#endif
> +
> /**
> * struct drm_printer - drm output "stream"
> *
> @@ -255,101 +350,6 @@ static inline struct drm_printer drm_err_printer(struct drm_device *drm,
> return p;
> }
>
> -/**
> - * enum drm_debug_category - The DRM debug categories
> - *
> - * Each of the DRM debug logging macros use a specific category, and the logging
> - * is filtered by the drm.debug module parameter. This enum specifies the values
> - * for the interface.
> - *
> - * Each DRM_DEBUG_<CATEGORY> macro logs to DRM_UT_<CATEGORY> category, except
> - * DRM_DEBUG() logs to DRM_UT_CORE.
> - *
> - * Enabling verbose debug messages is done through the drm.debug parameter, each
> - * category being enabled by a bit:
> - *
> - * - drm.debug=0x1 will enable CORE messages
> - * - drm.debug=0x2 will enable DRIVER messages
> - * - drm.debug=0x3 will enable CORE and DRIVER messages
> - * - ...
> - * - drm.debug=0x1ff will enable all messages
> - *
> - * An interesting feature is that it's possible to enable verbose logging at
> - * run-time by echoing the debug value in its sysfs node::
> - *
> - * # echo 0xf > /sys/module/drm/parameters/debug
> - *
> - */
> -enum drm_debug_category {
> - /* These names must match those in DYNAMIC_DEBUG_CLASSBITS */
> - /**
> - * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c,
> - * drm_memory.c, ...
> - */
> - DRM_UT_CORE,
> - /**
> - * @DRM_UT_DRIVER: Used in the vendor specific part of the driver: i915,
> - * radeon, ... macro.
> - */
> - DRM_UT_DRIVER,
> - /**
> - * @DRM_UT_KMS: Used in the modesetting code.
> - */
> - DRM_UT_KMS,
> - /**
> - * @DRM_UT_PRIME: Used in the prime code.
> - */
> - DRM_UT_PRIME,
> - /**
> - * @DRM_UT_ATOMIC: Used in the atomic code.
> - */
> - DRM_UT_ATOMIC,
> - /**
> - * @DRM_UT_VBL: Used for verbose debug message in the vblank code.
> - */
> - DRM_UT_VBL,
> - /**
> - * @DRM_UT_STATE: Used for verbose atomic state debugging.
> - */
> - DRM_UT_STATE,
> - /**
> - * @DRM_UT_LEASE: Used in the lease code.
> - */
> - DRM_UT_LEASE,
> - /**
> - * @DRM_UT_DP: Used in the DP code.
> - */
> - DRM_UT_DP,
> - /**
> - * @DRM_UT_DRMRES: Used in the drm managed resources code.
> - */
> - DRM_UT_DRMRES
> -};
> -
> -static inline bool drm_debug_enabled_raw(enum drm_debug_category category)
> -{
> - return unlikely(__drm_debug & BIT(category));
> -}
> -
> -#define drm_debug_enabled_instrumented(category) \
> - ({ \
> - pr_debug("todo: is this frequent enough to optimize ?\n"); \
> - drm_debug_enabled_raw(category); \
> - })
> -
> -#if defined(CONFIG_DRM_USE_DYNAMIC_DEBUG)
> -/*
> - * the drm.debug API uses dyndbg, so each drm_*dbg macro/callsite gets
> - * a descriptor, and only enabled callsites are reachable. They use
> - * the private macro to avoid re-testing the enable-bit.
> - */
> -#define __drm_debug_enabled(category) true
> -#define drm_debug_enabled(category) drm_debug_enabled_instrumented(category)
> -#else
> -#define __drm_debug_enabled(category) drm_debug_enabled_raw(category)
> -#define drm_debug_enabled(category) drm_debug_enabled_raw(category)
> -#endif
> -
> /*
> * struct device based logging
> *
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
--
Cheers,
Luca.
next prev parent reply other threads:[~2024-01-30 10:11 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 13:07 [PATCH 00/10] drm: drm debug and error logging improvements Jani Nikula
2024-01-16 13:07 ` [PATCH 01/10] drm/print: make drm_err_printer() device specific by using drm_err() Jani Nikula
2024-01-30 10:08 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 02/10] drm/print: move enum drm_debug_category etc. earlier in drm_print.h Jani Nikula
2024-01-30 10:11 ` Luca Coelho [this message]
2024-01-16 13:07 ` [PATCH 03/10] drm/print: add drm_dbg_printer() for drm device specific printer Jani Nikula
2024-01-30 10:19 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 04/10] drm/dp_mst: switch from drm_debug_printer() to device specific drm_dbg_printer() Jani Nikula
2024-01-30 10:20 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 05/10] drm/mode: " Jani Nikula
2024-01-30 10:23 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 06/10] drm/dp: switch drm_dp_vsc_sdp_log() to struct drm_printer Jani Nikula
2024-01-30 10:26 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 07/10] drm/i915: switch from drm_debug_printer() to device specific drm_dbg_printer() Jani Nikula
2024-01-30 10:27 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 08/10] drm/i915: use drm_printf() with the drm_err_printer intead of pr_err() Jani Nikula
2024-01-30 10:28 ` Luca Coelho
2024-01-16 13:07 ` [PATCH 09/10] drm/xe: switch from drm_debug_printer() to device specific drm_dbg_printer() Jani Nikula
2024-01-30 10:32 ` Luca Coelho
2024-02-01 12:52 ` Jani Nikula
2024-02-01 16:16 ` Lucas De Marchi
2024-02-09 12:07 ` Jani Nikula
2024-01-16 13:07 ` [PATCH 10/10] drm: remove drm_debug_printer in favor of drm_dbg_printer Jani Nikula
2024-01-30 10:35 ` Luca Coelho
2024-01-16 14:15 ` ✓ CI.Patch_applied: success for drm: drm debug and error logging improvements Patchwork
2024-01-16 14:16 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-16 14:16 ` ✓ CI.KUnit: success " Patchwork
2024-01-16 14:19 ` ✗ CI.Build: failure " Patchwork
2024-02-01 12:51 ` [PATCH 00/10] " Jani Nikula
2024-02-01 14:43 ` Maxime Ripard
2024-02-09 11:40 ` Jani Nikula
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=af97f8a21816578b32c3be96ea5f50eea6fc8a1b.camel@coelho.fi \
--to=luca@coelho.fi \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/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