Print backtraces when we do a warn()
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 23 Jul 2018 19:15:06 +0000 (15:15 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 23 Jul 2018 19:15:06 +0000 (15:15 -0400)
Helps syzbot and our own debugging.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/init.c

index 858a74f..81c1c59 100644 (file)
@@ -318,8 +318,10 @@ void _warn(const char *file, int line, const char *fmt,...)
        printk("\nkernel warning at %s:%d, from core %d: ", file, line,
               core_id_early());
        vcprintf(fmt, ap);
-       cprintf("\n");
+       printk("\n");
        va_end(ap);
+       backtrace();
+       printk("\n");
        print_unlock();
 }