diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index e3b1cab9e56b5da29f5a6092c04636c0bf81a4ea..76447e578572fcdd32b78908eb4e97c0d58ea1f1 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -102,6 +102,9 @@ char debug_file_path[1024] = "/r/tmp/lustre-log"; #else char debug_file_path[1024] = "/tmp/lustre-log"; #endif +CFS_MODULE_PARM(debug_file_path, "s", charp, 0644, + "Path for dumping debug logs, " + "set 'NONE' to prevent log dumping"); int libcfs_panic_in_progress; @@ -402,11 +405,14 @@ void libcfs_debug_dumplog_internal(void *arg) CFS_PUSH_JOURNAL; - snprintf(debug_file_name, sizeof(debug_file_path) - 1, "%s.%ld.%ld", - debug_file_path, cfs_time_current_sec(), (long)arg); - printk(KERN_ALERT "LustreError: dumping log to %s\n", debug_file_name); - tracefile_dump_all_pages(debug_file_name); - + if (strncmp(debug_file_path, "NONE", 4) != 0) { + snprintf(debug_file_name, sizeof(debug_file_path) - 1, + "%s.%ld.%ld", debug_file_path, cfs_time_current_sec(), + (long)arg); + printk(KERN_ALERT "LustreError: dumping log to %s\n", + debug_file_name); + tracefile_dump_all_pages(debug_file_name); + } CFS_POP_JOURNAL; }