@@ -8,6 +8,15 @@ config LNET
case of Lustre routers only the LNet layer is required. Lately other
projects are also looking into using LNet as their networking API as well.
+config LNET_DUMP_ON_PANIC
+ bool "LNet dump logs on panic"
+ depends on LNET
+ help
+ Special funcitonality to enable collecting extra logs when LNet panics.
+ Normally only used by developers for debugging purposes.
+
+ If unsure, say N.
+
config LNET_SELFTEST
tristate "Lustre networking self testing"
depends on LNET
@@ -503,6 +503,15 @@ static int panic_notifier(struct notifier_block *self, unsigned long unused1,
libcfs_panic_in_progress = 1;
mb();
+#ifdef CONFIG_LNET_DUMP_ON_PANIC
+ /* This is currently disabled because it spews far too much to the
+ * console on the rare cases it is ever triggered.
+ */
+ if (in_interrupt())
+ cfs_trace_debug_print();
+ else
+ libcfs_debug_dumplog_internal((void *)(long)current->pid);
+#endif
return 0;
}
@@ -764,6 +764,7 @@ static void put_pages_on_daemon_list(struct page_collection *pc)
}
}
+#ifdef CONFIG_LNET_DUMP_ON_PANIC
void cfs_trace_debug_print(void)
{
struct page_collection pc;
@@ -801,6 +802,7 @@ void cfs_trace_debug_print(void)
cfs_tage_free(tage);
}
}
+#endif /* CONFIG_LNET_DUMP_ON_PANIC */
int cfs_tracefile_dump_all_pages(char *filename)
{