From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Francois Dugast <francois.dugast@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH v2 3/3] drm/xe/macro: Display XE_WARN_ON messages only in debug mode
Date: Thu, 27 Jul 2023 10:03:43 -0400 [thread overview]
Message-ID: <ZMJ5P0Bn8O8T39of@intel.com> (raw)
In-Reply-To: <20230727132630.7-4-francois.dugast@intel.com>
On Thu, Jul 27, 2023 at 01:26:30PM +0000, Francois Dugast wrote:
> Make printing of XE_WARN_ON messages depend on Xe debug flag
> CONFIG_DRM_XE_DEBUG, so that those messages are not printed in production
> environments.
>
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
> ---
> drivers/gpu/drm/xe/xe_macros.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
> index daf56c846d03..6ce86cf9605c 100644
> --- a/drivers/gpu/drm/xe/xe_macros.h
> +++ b/drivers/gpu/drm/xe/xe_macros.h
> @@ -8,7 +8,14 @@
>
> #include <linux/bug.h>
>
> +#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
> #define XE_WARN_ON WARN_ON
> +#else
> +#define XE_WARN_ON(condition) ({ \
> + int __ret_warn_on = !!(condition); \
> + unlikely(__ret_warn_on); \
> +})
> +#endif
What about getting rid of XE_WARN_ON all together and replacing with
regular WARN_ON or drm_warn when we need the stack info or drm_{err,dbg,info}
on other cases?
I'm afraid that if we add this condition here now we will pave or way to
have a driver full of xe-isms instead of aligning with other regular drivers.
>
> #define XE_IOCTL_DBG(xe, cond) \
> ((cond) && (drm_dbg(&(xe)->drm, \
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-07-27 14:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 13:26 [Intel-xe] [PATCH v2 0/3] Remove use of BUG_ON Francois Dugast
2023-07-27 13:26 ` [Intel-xe] [PATCH v2 1/3] drm/xe/macro: Remove unused constant Francois Dugast
2023-07-27 13:56 ` Rodrigo Vivi
2023-07-27 13:26 ` [Intel-xe] [PATCH v2 2/3] drm/xe: Prefer WARN() over BUG() to avoid crashing the kernel Francois Dugast
2023-07-27 14:01 ` Rodrigo Vivi
2023-07-27 13:26 ` [Intel-xe] [PATCH v2 3/3] drm/xe/macro: Display XE_WARN_ON messages only in debug mode Francois Dugast
2023-07-27 14:03 ` Rodrigo Vivi [this message]
2023-07-27 14:42 ` Francois Dugast
2023-07-27 13:48 ` [Intel-xe] ✓ CI.Patch_applied: success for Remove use of BUG_ON Patchwork
2023-07-27 13:48 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-07-27 13:49 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-07-27 13:53 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-27 13:54 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-27 13:55 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-07-27 14:29 ` [Intel-xe] ○ CI.BAT: info " Patchwork
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=ZMJ5P0Bn8O8T39of@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=francois.dugast@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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 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.