From: Mr NeilBrown Date: Tue, 9 Feb 2021 04:30:46 +0000 (+1100) Subject: LU-14427 libcfs: restore LNET_DUMP_ON_PANIC functionality. X-Git-Tag: 2.14.51~32 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f9b75c5fb4d4e39759a2d3cb8e67a4312ff4ae5a LU-14427 libcfs: restore LNET_DUMP_ON_PANIC functionality. The functionality enabled by --enable-panic-dumplog was inadvertently removed in Commit ae0704381efc ("LU-9859 libcfs: merge linux-debug.c into debug.c") Restore it. While we are there, add conditional-compliation for other code that is only needed when this is enabled. Test-Parameters: trivial Fixes: ae0704381efc ("LU-9859 libcfs: merge linux-debug.c into debug.c") Signed-off-by: Mr NeilBrown Change-Id: If85882045c66e54ff8493396589d4ecbf13f8f3d Reviewed-on: https://review.whamcloud.com/41488 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index b6d8b42..d82b2c1 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -637,6 +637,16 @@ static int panic_notifier(struct notifier_block *self, unsigned long unused1, libcfs_panic_in_progress = 1; mb(); +#ifdef 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; } diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index d3a0803..b32f458 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -760,6 +760,7 @@ static void put_pages_on_daemon_list(struct page_collection *pc) } } +#ifdef LNET_DUMP_ON_PANIC void cfs_trace_debug_print(void) { struct page_collection pc; @@ -796,6 +797,7 @@ void cfs_trace_debug_print(void) cfs_tage_free(tage); } } +#endif /* LNET_DUMP_ON_PANIC */ int cfs_tracefile_dump_all_pages(char *filename) {