Whamcloud - gitweb
LU-1481 build: quiet warnings due to := assignment
[fs/lustre-release.git] / libcfs / libcfs / debug.c
index fb93ac2..aa04538 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  *
  * Author: Phil Schwan <phil@clusterfs.com>
  *
- * Copyright (c) 2011 Whamcloud, Inc.
- *
  */
 
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
 # define DEBUG_SUBSYSTEM S_LNET
 
 #include <libcfs/libcfs.h>
@@ -57,7 +51,7 @@ CFS_MODULE_PARM(libcfs_subsystem_debug, "i", int, 0644,
                 "Lustre kernel debug subsystem mask");
 EXPORT_SYMBOL(libcfs_subsystem_debug);
 
-unsigned int libcfs_debug = (D_EMERG | D_ERROR | D_WARNING | D_CONSOLE |
+unsigned int libcfs_debug = (D_CANTMASK |
                              D_NETERROR | D_HA | D_CONFIG | D_IOCTL);
 CFS_MODULE_PARM(libcfs_debug, "i", int, 0644,
                 "Lustre kernel debug mask");
@@ -78,13 +72,13 @@ CFS_MODULE_PARM(libcfs_console_ratelimit, "i", uint, 0644,
                 "Lustre kernel debug console ratelimit (0 to disable)");
 EXPORT_SYMBOL(libcfs_console_ratelimit);
 
-cfs_duration_t libcfs_console_max_delay;
-CFS_MODULE_PARM(libcfs_console_max_delay, "l", ulong, 0644,
+unsigned int libcfs_console_max_delay;
+CFS_MODULE_PARM(libcfs_console_max_delay, "l", uint, 0644,
                 "Lustre kernel debug console max delay (jiffies)");
 EXPORT_SYMBOL(libcfs_console_max_delay);
 
-cfs_duration_t libcfs_console_min_delay;
-CFS_MODULE_PARM(libcfs_console_min_delay, "l", ulong, 0644,
+unsigned int libcfs_console_min_delay;
+CFS_MODULE_PARM(libcfs_console_min_delay, "l", uint, 0644,
                 "Lustre kernel debug console min delay (jiffies)");
 EXPORT_SYMBOL(libcfs_console_min_delay);
 
@@ -96,7 +90,7 @@ EXPORT_SYMBOL(libcfs_console_backoff);
 unsigned int libcfs_debug_binary = 1;
 EXPORT_SYMBOL(libcfs_debug_binary);
 
-unsigned int libcfs_stack;
+unsigned int libcfs_stack = 3 * THREAD_SIZE / 4;
 EXPORT_SYMBOL(libcfs_stack);
 
 unsigned int portal_enter_debugger;
@@ -170,6 +164,8 @@ libcfs_debug_subsys2str(int subsys)
                 return "lov";
         case S_LQUOTA:
                 return "lquota";
+       case S_OSD:
+               return "osd";
         case S_LMV:
                 return "lmv";
         case S_SEC:
@@ -251,7 +247,9 @@ libcfs_debug_dbg2str(int debug)
                 return "quota";
         case D_SEC:
                 return "sec";
-        }
+       case D_LFSCK:
+               return "lfsck";
+       }
 }
 
 int
@@ -386,6 +384,7 @@ void libcfs_debug_dumplog(void)
         cfs_waitq_del(&debug_ctlwq, &wait);
         cfs_set_current_state(CFS_TASK_RUNNING);
 }
+EXPORT_SYMBOL(libcfs_debug_dumplog);
 
 int libcfs_debug_init(unsigned long bufsize)
 {
@@ -458,5 +457,20 @@ void libcfs_debug_set_level(unsigned int debug_level)
         libcfs_debug = debug_level;
 }
 
-EXPORT_SYMBOL(libcfs_debug_dumplog);
 EXPORT_SYMBOL(libcfs_debug_set_level);
+
+long libcfs_log_return(struct libcfs_debug_msg_data *msgdata, long rc)
+{
+        libcfs_debug_msg(msgdata, "Process leaving (rc=%lu : %ld : %lx)\n",
+                         rc, rc, rc);
+        return rc;
+}
+EXPORT_SYMBOL(libcfs_log_return);
+
+void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, const char *label,
+                     long_ptr_t rc)
+{
+        libcfs_debug_msg(msgdata, "Process leaving via %s (rc=" LPLU " : " LPLD
+                         " : " LPLX ")\n", label, (ulong_ptr_t)rc, rc, rc);
+}
+EXPORT_SYMBOL(libcfs_log_goto);