Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] kernel/panic: Repeat the line and caller information at the end of the OOPS
@ 2018-02-26 13:53 Chris Wilson
  2018-02-26 13:59 ` Lofstedt, Marta
  2018-02-26 14:19 ` ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 9+ messages in thread
From: Chris Wilson @ 2018-02-26 13:53 UTC (permalink / raw)
  To: intel-gfx

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>
---
 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-02-27 20:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26 13:53 [RFC] kernel/panic: Repeat the line and caller information at the end of the OOPS Chris Wilson
2018-02-26 13:59 ` Lofstedt, Marta
2018-02-26 14:19 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-02-26 14:29   ` [RFC] " Chris Wilson
2018-02-27 10:50     ` Chris Wilson
2018-02-27 11:12       ` Lofstedt, Marta
2018-02-27 20:57         ` Chris Wilson
2018-02-26 14:57   ` ✓ Fi.CI.BAT: success for kernel/panic: Repeat the line and caller information at the end of the OOPS (rev2) Patchwork
2018-02-26 18:15   ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox