Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / libcfs / libcfs / debug.c
index 0728759..5813e68 100644 (file)
@@ -65,7 +65,7 @@ CFS_MODULE_PARM(libcfs_debug_mb, "i", int, 0644,
                 "Total debug buffer size.");
 EXPORT_SYMBOL(libcfs_debug_mb);
 
-unsigned int libcfs_printk = D_CANTMASK;
+unsigned int libcfs_printk = (D_CANTMASK | D_NETERROR);
 CFS_MODULE_PARM(libcfs_printk, "i", uint, 0644,
                 "Lustre kernel debug console mask");
 EXPORT_SYMBOL(libcfs_printk);
@@ -102,7 +102,10 @@ EXPORT_SYMBOL(portal_enter_debugger);
 unsigned int libcfs_catastrophe;
 EXPORT_SYMBOL(libcfs_catastrophe);
 
-unsigned int libcfs_panic_on_lbug = 0;
+unsigned int libcfs_watchdog_ratelimit = 300;
+EXPORT_SYMBOL(libcfs_watchdog_ratelimit);
+
+unsigned int libcfs_panic_on_lbug = 1;
 CFS_MODULE_PARM(libcfs_panic_on_lbug, "i", uint, 0644,
                 "Lustre kernel panic on LBUG");
 EXPORT_SYMBOL(libcfs_panic_on_lbug);
@@ -115,7 +118,7 @@ static cfs_waitq_t debug_ctlwq;
 char debug_file_path_arr[1024] = DEBUG_FILE_PATH_DEFAULT;
 
 /* We need to pass a pointer here, but elsewhere this must be a const */
-static char *debug_file_path = &debug_file_path_arr[0];
+char *debug_file_path = &debug_file_path_arr[0];
 CFS_MODULE_PARM(debug_file_path, "s", charp, 0644,
                 "Path for dumping debug logs, "
                 "set 'NONE' to prevent log dumping");
@@ -383,8 +386,14 @@ int libcfs_debug_init(unsigned long bufsize)
         int    max = libcfs_debug_mb;
 
         cfs_waitq_init(&debug_ctlwq);
-        libcfs_console_max_delay = CDEBUG_DEFAULT_MAX_DELAY;
-        libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
+
+        if (libcfs_console_max_delay <= 0 || /* not set by user or */
+            libcfs_console_min_delay <= 0 || /* set to invalid values */
+            libcfs_console_min_delay >= libcfs_console_max_delay) {
+                libcfs_console_max_delay = CDEBUG_DEFAULT_MAX_DELAY;
+                libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
+        }
+
         /* If libcfs_debug_mb is set to an invalid value or uninitialized
          * then just make the total buffers smp_num_cpus * TCD_MAX_PAGES */
         if (max > trace_max_debug_mb() || max < num_possible_cpus()) {
@@ -421,7 +430,7 @@ int libcfs_debug_clear_buffer(void)
 int libcfs_debug_mark_buffer(const char *text)
 {
         CDEBUG(D_TRACE,"***************************************************\n");
-        CDEBUG(D_WARNING, "DEBUG MARKER: %s\n", text);
+        LCONSOLE(D_WARNING, "DEBUG MARKER: %s\n", text);
         CDEBUG(D_TRACE,"***************************************************\n");
 
         return 0;