[PATCH] drm/amd/display: Make BREAK_TO_DEBUGGER() a debug print
Michel Dänzer
michel at daenzer.net
Mon May 25 09:13:26 UTC 2020
On 2020-05-22 8:03 p.m., Nicholas Kazlauskas wrote:
> [Why]
> Warnings in the kernel are generally treated as errors.
>
> The BREAK_TO_DEBUGGER macro is not a critical error or warning, but
> rather intended for developer use to help investigate behavior and
> sequences for other issues.
>
> We do still make use of DC_ERROR/ASSERT(0) in various places in the
> code for things that are genuine issues.
>
> Since most developers don't actually KGDB while debugging the kernel
> these essentially would have no value on their own since the KGDB
> breakpoint wouldn't trigger - ASSERT(0) was used as a shortcut to get
> a stacktrace.
>
> [How]
> Turn it into a DRM_DEBUG_DRIVER print instead. We unfortunately lose
> the stacktrace, but we still do retain some of the useful debug
> information this offers by having at least the function and line
> number loggable.
>
> If KGDB is supported in the kernel this will still trigger a real
> breakpoint as well.
Not sure this makes sense now that WARN_ON_ONCE is used for ASSERT().
The name "BREAK_TO_DEBUGGER" implies that something unexpected happened
which needs to be investigated, so having a backtrace seems important to me.
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list