Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66fcb105 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt
Browse files

powerpc: Add last sysfs file and dump of ftrace buffer to oops printout



Add printout of last accessed sysfs file, added to x86 in
ae87221d (sysfs: crash debugging)

Also add the notify_die hook that allows us to print out the ftrace
buffer on oops. This is useful in conjunction with ftrace function_graph:

Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=128 NUMA pSeries
last sysfs file: /sys/class/net/tunl0/type
Dumping ftrace buffer:

...

  0)               |                .sysrq_handle_crash() {
  0)   0.476 us    |                  .hash_page();
  0)   0.488 us    |                  .xmon_fault_handler();
  0)               |                  .bad_page_fault() {
  0)               |                    .search_exception_tables() {
  0)   0.590 us    |                      .search_module_extables();
  0)   2.546 us    |                    }
  0)               |                    .printk() {
  0)               |                      .vprintk() {
  0)   0.488 us    |                        ._raw_spin_lock();
  0)   0.572 us    |                        .emit_log_char();

Showing the function graph of a sysrq-c crash.

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent b926a88a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -146,6 +146,11 @@ int die(const char *str, struct pt_regs *regs, long err)
#endif
		printk("%s\n", ppc_md.name ? ppc_md.name : "");

		sysfs_printk_last_file();
		if (notify_die(DIE_OOPS, str, regs, err, 255,
			       SIGSEGV) == NOTIFY_STOP)
			return 1;

		print_modules();
		show_regs(regs);
	} else {