Whamcloud - gitweb
LU-14427 libcfs: restore LNET_DUMP_ON_PANIC functionality. 88/41488/2
authorMr NeilBrown <neilb@suse.de>
Tue, 9 Feb 2021 04:30:46 +0000 (15:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Mar 2021 18:34:07 +0000 (18:34 +0000)
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 <neilb@suse.de>
Change-Id: If85882045c66e54ff8493396589d4ecbf13f8f3d
Reviewed-on: https://review.whamcloud.com/41488
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/debug.c
libcfs/libcfs/tracefile.c

index b6d8b42..d82b2c1 100644 (file)
@@ -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;
 }
 
index d3a0803..b32f458 100644 (file)
@@ -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)
 {