Re: [CI] drm/i915: Print the condition causing GEM_BUG_ON

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I like this, because I would not need to check the actual code when we get BUG() backtraces for CI.

Reviewed-by: Marta Lofstedt <marta.lofstedt@xxxxxxxxx>

> -----Original Message-----
> From: Mika Kuoppala [mailto:mika.kuoppala@xxxxxxxxxxxxxxx]
> Sent: Thursday, November 16, 2017 10:40 AM
> To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>; Chris Wilson
> <chris@xxxxxxxxxxxxxxxxxx>; Joonas Lahtinen
> <joonas.lahtinen@xxxxxxxxxxxxxxx>; Lofstedt, Marta
> <marta.lofstedt@xxxxxxxxx>
> Subject: [CI] drm/i915: Print the condition causing GEM_BUG_ON
> 
> It is easier to categorize and debug bugs if the failed condition is in plain sight
> in the actual dmesg output. Make it so.
> 
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Marta Lofstedt <marta.lofstedt@xxxxxxxxx>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_gem.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.h
> b/drivers/gpu/drm/i915/i915_gem.h index ff42b5f0e981..e920dab7f1b8
> 100644
> --- a/drivers/gpu/drm/i915/i915_gem.h
> +++ b/drivers/gpu/drm/i915/i915_gem.h
> @@ -28,7 +28,11 @@
>  #include <linux/bug.h>
> 
>  #ifdef CONFIG_DRM_I915_DEBUG_GEM
> -#define GEM_BUG_ON(expr) BUG_ON(expr)
> +#define GEM_BUG_ON(condition) do { if (unlikely((condition))) {	\
> +		printk(KERN_ERR "GEM_BUG_ON(%s)\n",
> __stringify(condition)); \
> +		BUG(); \
> +		} \
> +	} while(0)
>  #define GEM_WARN_ON(expr) WARN_ON(expr)
> 
>  #define GEM_DEBUG_DECL(var) var
> --
> 2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux