From: bwzhou Date: Fri, 9 May 2008 08:57:45 +0000 (+0000) Subject: Branch b1_6 X-Git-Tag: v1_9_50~523 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5d64932f45652ea7074a113a0207a5e594c2141b;p=fs%2Flustre-release.git Branch b1_6 b=13707 r=bobijam, johann exported debug_file_path as a module param of libcfs --- diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index e3b1cab..76447e5 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; }