Whamcloud - gitweb
b=1903
authorphil <phil>
Thu, 11 Sep 2003 18:28:03 +0000 (18:28 +0000)
committerphil <phil>
Thu, 11 Sep 2003 18:28:03 +0000 (18:28 +0000)
Add /proc/sys/portals/console which defaults to 1; if you set it to 0,
it will suppress all console output except LASSERTs

lnet/include/linux/kp30.h
lnet/libcfs/module.c
lnet/libcfs/proc.c
lnet/lnet/api-init.c
lnet/utils/portals.c
lustre/portals/include/linux/kp30.h
lustre/portals/libcfs/module.c
lustre/portals/libcfs/proc.c
lustre/portals/portals/api-init.c
lustre/portals/utils/portals.c

index a2ef568..1757317 100644 (file)
@@ -19,6 +19,7 @@ extern unsigned int portal_subsystem_debug;
 extern unsigned int portal_stack;
 extern unsigned int portal_debug;
 extern unsigned int portal_printk;
+extern unsigned int portal_cerror;
 /* Debugging subsystems (32 bits, non-overlapping) */
 #define S_UNDEFINED    (1 << 0)
 #define S_MDC          (1 << 1)
@@ -106,6 +107,8 @@ extern unsigned int portal_printk;
 #if 1
 #define CDEBUG(mask, format, a...)                                            \
 do {                                                                          \
+        if (portal_cerror == 0)                                               \
+                break;                                                        \
         CHECK_STACK(CDEBUG_STACK);                                            \
         if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) ||                      \
             (portal_debug & (mask) &&                                         \
index 7ecbe43..4948769 100644 (file)
@@ -546,6 +546,7 @@ EXPORT_SYMBOL(portal_subsystem_debug);
 EXPORT_SYMBOL(portal_debug);
 EXPORT_SYMBOL(portal_stack);
 EXPORT_SYMBOL(portal_printk);
+EXPORT_SYMBOL(portal_cerror);
 EXPORT_SYMBOL(PtlEQWait);
 EXPORT_SYMBOL(PtlEQFree);
 EXPORT_SYMBOL(PtlEQGet);
index 8817ace..c1b2aec 100644 (file)
@@ -65,11 +65,12 @@ extern char portals_upcall[1024];
 #define PSDEV_DEBUG           1   /* control debugging */
 #define PSDEV_SUBSYSTEM_DEBUG 2   /* control debugging */
 #define PSDEV_PRINTK          3   /* force all errors to console */
-#define PSDEV_DEBUG_PATH      4   /* crashdump log location */
-#define PSDEV_DEBUG_DUMP_PATH 5   /* crashdump tracelog location */
-#define PSDEV_PORTALS_UPCALL  6   /* User mode upcall script  */
+#define PSDEV_CONSOLE         4   /* allow _any_ messages to console */
+#define PSDEV_DEBUG_PATH      5   /* crashdump log location */
+#define PSDEV_DEBUG_DUMP_PATH 6   /* crashdump tracelog location */
+#define PSDEV_PORTALS_UPCALL  7   /* User mode upcall script  */
 
-#define PORTALS_PRIMARY_CTLCNT 6
+#define PORTALS_PRIMARY_CTLCNT 7
 static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = {
         {PSDEV_DEBUG, "debug", &portal_debug, sizeof(int), 0644, NULL,
          &proc_dointvec},
@@ -77,6 +78,8 @@ static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = {
          sizeof(int), 0644, NULL, &proc_dointvec},
         {PSDEV_PRINTK, "printk", &portal_printk, sizeof(int), 0644, NULL,
          &proc_dointvec},
+        {PSDEV_CONSOLE, "console", &portal_cerror, sizeof(int), 0644, NULL,
+         &proc_dointvec},
         {PSDEV_DEBUG_PATH, "debug_path", debug_file_path,
          sizeof(debug_file_path), 0644, NULL, &proc_dostring, &sysctl_string},
         {PSDEV_DEBUG_DUMP_PATH, "debug_daemon_path", debug_daemon_file_path,
index dc1fead..f77a439 100644 (file)
@@ -28,6 +28,7 @@
 int ptl_init;
 unsigned int portal_subsystem_debug = ~0 - (S_PORTALS | S_QSWNAL | S_SOCKNAL | S_GMNAL);
 unsigned int portal_debug = ~0;
+unsigned int portal_cerror = 1;
 unsigned int portal_printk;
 unsigned int portal_stack;
 
index d8bffab..d70a4f2 100644 (file)
@@ -45,7 +45,7 @@
 unsigned int portal_debug;
 unsigned int portal_printk;
 unsigned int portal_stack;
-
+unsigned int portal_cerror;
 
 static unsigned int g_nal = 0;
 
index a2ef568..1757317 100644 (file)
@@ -19,6 +19,7 @@ extern unsigned int portal_subsystem_debug;
 extern unsigned int portal_stack;
 extern unsigned int portal_debug;
 extern unsigned int portal_printk;
+extern unsigned int portal_cerror;
 /* Debugging subsystems (32 bits, non-overlapping) */
 #define S_UNDEFINED    (1 << 0)
 #define S_MDC          (1 << 1)
@@ -106,6 +107,8 @@ extern unsigned int portal_printk;
 #if 1
 #define CDEBUG(mask, format, a...)                                            \
 do {                                                                          \
+        if (portal_cerror == 0)                                               \
+                break;                                                        \
         CHECK_STACK(CDEBUG_STACK);                                            \
         if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) ||                      \
             (portal_debug & (mask) &&                                         \
index 7ecbe43..4948769 100644 (file)
@@ -546,6 +546,7 @@ EXPORT_SYMBOL(portal_subsystem_debug);
 EXPORT_SYMBOL(portal_debug);
 EXPORT_SYMBOL(portal_stack);
 EXPORT_SYMBOL(portal_printk);
+EXPORT_SYMBOL(portal_cerror);
 EXPORT_SYMBOL(PtlEQWait);
 EXPORT_SYMBOL(PtlEQFree);
 EXPORT_SYMBOL(PtlEQGet);
index 8817ace..c1b2aec 100644 (file)
@@ -65,11 +65,12 @@ extern char portals_upcall[1024];
 #define PSDEV_DEBUG           1   /* control debugging */
 #define PSDEV_SUBSYSTEM_DEBUG 2   /* control debugging */
 #define PSDEV_PRINTK          3   /* force all errors to console */
-#define PSDEV_DEBUG_PATH      4   /* crashdump log location */
-#define PSDEV_DEBUG_DUMP_PATH 5   /* crashdump tracelog location */
-#define PSDEV_PORTALS_UPCALL  6   /* User mode upcall script  */
+#define PSDEV_CONSOLE         4   /* allow _any_ messages to console */
+#define PSDEV_DEBUG_PATH      5   /* crashdump log location */
+#define PSDEV_DEBUG_DUMP_PATH 6   /* crashdump tracelog location */
+#define PSDEV_PORTALS_UPCALL  7   /* User mode upcall script  */
 
-#define PORTALS_PRIMARY_CTLCNT 6
+#define PORTALS_PRIMARY_CTLCNT 7
 static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = {
         {PSDEV_DEBUG, "debug", &portal_debug, sizeof(int), 0644, NULL,
          &proc_dointvec},
@@ -77,6 +78,8 @@ static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = {
          sizeof(int), 0644, NULL, &proc_dointvec},
         {PSDEV_PRINTK, "printk", &portal_printk, sizeof(int), 0644, NULL,
          &proc_dointvec},
+        {PSDEV_CONSOLE, "console", &portal_cerror, sizeof(int), 0644, NULL,
+         &proc_dointvec},
         {PSDEV_DEBUG_PATH, "debug_path", debug_file_path,
          sizeof(debug_file_path), 0644, NULL, &proc_dostring, &sysctl_string},
         {PSDEV_DEBUG_DUMP_PATH, "debug_daemon_path", debug_daemon_file_path,
index dc1fead..f77a439 100644 (file)
@@ -28,6 +28,7 @@
 int ptl_init;
 unsigned int portal_subsystem_debug = ~0 - (S_PORTALS | S_QSWNAL | S_SOCKNAL | S_GMNAL);
 unsigned int portal_debug = ~0;
+unsigned int portal_cerror = 1;
 unsigned int portal_printk;
 unsigned int portal_stack;
 
index d8bffab..d70a4f2 100644 (file)
@@ -45,7 +45,7 @@
 unsigned int portal_debug;
 unsigned int portal_printk;
 unsigned int portal_stack;
-
+unsigned int portal_cerror;
 
 static unsigned int g_nal = 0;