summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-02-26 14:29:56 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2018-09-12 14:34:48 +0200
commitf04240052015dd429fc764be13600572c5f45a50 (patch)
treea67fda359073952f0bd85cfe4dd0a7059d01ea92
parent43e3120431de5bfc47c86d4c0ffcf33d5ac2ad76 (diff)
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 <chris@chris-wilson.co.uk> Cc: Marta Lofstedt <marta.lofstedt@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180226142957.6549-1-chris@chris-wilson.co.uk
-rw-r--r--kernel/panic.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 8b2e002d52eb..9e0ec099e27c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -506,14 +506,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 show_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,
@@ -524,6 +519,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) {
/*
@@ -545,6 +551,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
print_irqtrace_events(current);
+ show_location(file, line, caller, args);
+
print_oops_end_marker();
/* Just a warning, don't kill lockdep. */