Seems like a good idea to me.

+Mika

> -----Original Message-----
> From: Chris Wilson [mailto:[email protected]]
> Sent: Monday, February 26, 2018 3:53 PM
> To: [email protected]
> Cc: Chris Wilson <[email protected]>; Lofstedt, Marta
> <[email protected]>
> Subject: [RFC] kernel/panic: Repeat the line and caller information at the end
> of the OOPS
> 
> For large oops dump, for example if ftrace is included, we can easily exceed
> the storage buffer and lose the most important bit of
> information: where the OOPS occurred. So repeat the location information
> just before the end marker.
> 
> Signed-off-by: Chris Wilson <[email protected]>
> Cc: Marta Lofstedt <[email protected]>
> ---
>  kernel/panic.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/kernel/panic.c b/kernel/panic.c index 2cfef408fec9..51914dcd1ab8
> 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -517,14 +517,9 @@ struct warn_args {
>       va_list args;
>  };
> 
> -void __warn(const char *file, int line, void *caller, unsigned taint,
> -         struct pt_regs *regs, struct warn_args *args)
> +static void print_location(const char *file, int line, void *caller,
> +                        struct warn_args *args)
>  {
> -     disable_trace_on_warning();
> -
> -     if (args)
> -             pr_warn(CUT_HERE);
> -
>       if (file)
>               pr_warn("WARNING: CPU: %d PID: %d at %s:%d
> %pS\n",
>                       raw_smp_processor_id(),
> current->pid, file, line, @@ -535,6 +530,17 @@ void __warn(const char *file,
> int line, void *caller, unsigned taint,
> 
>       if (args)
>               vprintk(args->fmt, args->args);
> +}
> +
> +void __warn(const char *file, int line, void *caller, unsigned taint,
> +         struct pt_regs *regs, struct warn_args *args) {
> +     disable_trace_on_warning();
> +
> +     if (args)
> +             pr_warn(CUT_HERE);
> +
> +     show_location(file, line, caller, args);
> 
>       if (panic_on_warn) {
>               /*
> @@ -554,6 +560,8 @@ void __warn(const char *file, int line, void *caller,
> unsigned taint,
>       else
>               dump_stack();
> 
> +     show_location(file, line, caller, args);
> +
>       print_oops_end_marker();
> 
>       /* Just a warning, don't kill lockdep. */
> --
> 2.16.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to