Whamcloud - gitweb
Quiet some LustreError messages that are not really errors.
authoradilger <adilger>
Thu, 16 Oct 2003 23:44:50 +0000 (23:44 +0000)
committeradilger <adilger>
Thu, 16 Oct 2003 23:44:50 +0000 (23:44 +0000)
Make CWARN() output to the console as a replacement (just prefix Lustre:).

lnet/libcfs/debug.c
lustre/portals/libcfs/debug.c

index 2a6a474..9671278 100644 (file)
@@ -292,10 +292,8 @@ int portals_debug_daemon(void *arg)
         if (!file || IS_ERR(file)) {
                 CERROR("cannot open %s for logging", debug_daemon_file_path);
                 GOTO(out1, PTR_ERR(file));
-        } else {
-                printk(KERN_ALERT "LustreError: daemon dumping log to %s ... writing ...\n",
-                       debug_daemon_file_path);
         }
+        printk(KERN_INFO "daemon dumping log to %s\n", debug_daemon_file_path);
 
         debug_daemon_state.overlapped = 0;
         debug_daemon_state.stopped = 0;
@@ -339,8 +337,8 @@ int portals_debug_daemon(void *arg)
                         rc = file->f_op->write(file, debug_buf+start,
                                                size, &file->f_pos);
                         if (rc < 0) {
-                                printk(KERN_ALERT
-                                           "LustreError: Debug_daemon write error %d\n", rc);
+                                printk(KERN_ALERT "LustreError: Debug_daemon "
+                                       "write error %d\n", rc);
                                 goto out;
                         }
                         start += rc;
@@ -361,16 +359,16 @@ int portals_debug_daemon(void *arg)
                 if (force_flush) {
                         rc = file->f_op->fsync(file, file->f_dentry, 1);
                         if (rc < 0) {
-                                printk(KERN_ALERT
-                                       "LustreError: Debug_daemon sync error %d\n", rc);
+                                printk(KERN_ALERT "LustreError: Debug_daemon "
+                                       "sync error %d\n", rc);
                                 goto out;
                         }
                         if (debug_daemon_state.stopped)
-                               break;           
+                               break;
                         debug_daemon_state.lctl_event = 1;
                         wake_up(&debug_daemon_state.lctl);
                 }
-                wait_event(debug_daemon_state.daemon, 
+                wait_event(debug_daemon_state.daemon,
                            debug_daemon_state.daemon_event);
                 }
 out:
@@ -636,7 +634,7 @@ int portals_debug_mark_buffer(char *text)
                 return -EINVAL;
 
         CDEBUG(0, "********************************************************\n");
-        CERROR("DEBUG MARKER: %s\n", text);
+        CWARN("DEBUG MARKER: %s\n", text);
         CDEBUG(0, "********************************************************\n");
 
         return 0;
@@ -667,10 +665,10 @@ __s32 portals_debug_copy_to_user(char *buf, unsigned long len)
                 }
                 list_add(&page->list, &my_pages);
         }
-        
+
         spin_lock_irqsave(&portals_debug_lock, flags);
         debug_off = atomic_read(&debug_off_a);
-        
+
         /* Sigh. If the buffer is empty, then skip to the end. */
         if (debug_off == 0 && !debug_wrapped) {
                 spin_unlock_irqrestore(&portals_debug_lock, flags);
@@ -680,7 +678,7 @@ __s32 portals_debug_copy_to_user(char *buf, unsigned long len)
 
         if (debug_wrapped)
                 off = debug_off + 1;
-        else 
+        else
                 off = 0;
         copied = 0;
         list_for_each(pos, &my_pages) {
@@ -698,7 +696,7 @@ finish_partial:
                 copied += to_copy;
                 if (copied >= (debug_wrapped ? debug_size : debug_off))
                         break;
-                        
+
                 off += to_copy;
                 if (off >= debug_size) {
                         off = 0;
@@ -728,7 +726,7 @@ finish_partial:
                         break;
         }
         rc = copied;
-        
+
 cleanup:
         list_for_each_safe(pos, n, &my_pages) {
                 page = list_entry(pos, struct page, list);
@@ -786,8 +784,8 @@ portals_debug_msg(int subsys, int mask, char *file, const char *fn,
         max_nob = debug_size - debug_off + DEBUG_OVERFLOW;
         if (max_nob <= 0) {
                 spin_unlock_irqrestore(&portals_debug_lock, flags);
-                printk("LustreError: logic error in portals_debug_msg: <0 bytes"
-                       " to write\n");
+                printk("LustreError: logic error in portals_debug_msg: "
+                       "< 0 bytes to write\n");
                 return;
         }
 
@@ -831,11 +829,15 @@ portals_debug_msg(int subsys, int mask, char *file, const char *fn,
         if ((mask & D_EMERG) != 0)
                 printk(KERN_EMERG "LustreError: %s",
                        debug_buf + debug_off + prefix_nob);
-        if ((mask & D_ERROR) != 0)
-                printk(KERN_ERR   "LustreError: %s",
+        else if ((mask & D_ERROR) != 0)
+                printk(KERN_ERR "LustreError: %s",
+                       debug_buf + debug_off + prefix_nob);
+        else if ((mask & D_WARNING) != 0)
+                printk(KERN_WARNING "Lustre: %s",
                        debug_buf + debug_off + prefix_nob);
         else if (portal_printk)
-                printk("<%d>LustreError: %s", portal_printk, debug_buf+debug_off+prefix_nob);
+                printk("<%d>Lustre: %s", portal_printk,
+                       debug_buf+debug_off+prefix_nob);
         base_offset = debug_off & 0xFFFF;
 
         debug_off += prefix_nob + msg_nob;
@@ -878,7 +880,7 @@ void portals_run_upcall(char **argv)
                 argc++;
 
         LASSERT(argc >= 2);
-        
+
         rc = USERMODEHELPER(argv[0], argv, envp);
         if (rc < 0) {
                 CERROR("Error %d invoking portals upcall %s %s%s%s%s%s%s%s%s; "
index 2a6a474..9671278 100644 (file)
@@ -292,10 +292,8 @@ int portals_debug_daemon(void *arg)
         if (!file || IS_ERR(file)) {
                 CERROR("cannot open %s for logging", debug_daemon_file_path);
                 GOTO(out1, PTR_ERR(file));
-        } else {
-                printk(KERN_ALERT "LustreError: daemon dumping log to %s ... writing ...\n",
-                       debug_daemon_file_path);
         }
+        printk(KERN_INFO "daemon dumping log to %s\n", debug_daemon_file_path);
 
         debug_daemon_state.overlapped = 0;
         debug_daemon_state.stopped = 0;
@@ -339,8 +337,8 @@ int portals_debug_daemon(void *arg)
                         rc = file->f_op->write(file, debug_buf+start,
                                                size, &file->f_pos);
                         if (rc < 0) {
-                                printk(KERN_ALERT
-                                           "LustreError: Debug_daemon write error %d\n", rc);
+                                printk(KERN_ALERT "LustreError: Debug_daemon "
+                                       "write error %d\n", rc);
                                 goto out;
                         }
                         start += rc;
@@ -361,16 +359,16 @@ int portals_debug_daemon(void *arg)
                 if (force_flush) {
                         rc = file->f_op->fsync(file, file->f_dentry, 1);
                         if (rc < 0) {
-                                printk(KERN_ALERT
-                                       "LustreError: Debug_daemon sync error %d\n", rc);
+                                printk(KERN_ALERT "LustreError: Debug_daemon "
+                                       "sync error %d\n", rc);
                                 goto out;
                         }
                         if (debug_daemon_state.stopped)
-                               break;           
+                               break;
                         debug_daemon_state.lctl_event = 1;
                         wake_up(&debug_daemon_state.lctl);
                 }
-                wait_event(debug_daemon_state.daemon, 
+                wait_event(debug_daemon_state.daemon,
                            debug_daemon_state.daemon_event);
                 }
 out:
@@ -636,7 +634,7 @@ int portals_debug_mark_buffer(char *text)
                 return -EINVAL;
 
         CDEBUG(0, "********************************************************\n");
-        CERROR("DEBUG MARKER: %s\n", text);
+        CWARN("DEBUG MARKER: %s\n", text);
         CDEBUG(0, "********************************************************\n");
 
         return 0;
@@ -667,10 +665,10 @@ __s32 portals_debug_copy_to_user(char *buf, unsigned long len)
                 }
                 list_add(&page->list, &my_pages);
         }
-        
+
         spin_lock_irqsave(&portals_debug_lock, flags);
         debug_off = atomic_read(&debug_off_a);
-        
+
         /* Sigh. If the buffer is empty, then skip to the end. */
         if (debug_off == 0 && !debug_wrapped) {
                 spin_unlock_irqrestore(&portals_debug_lock, flags);
@@ -680,7 +678,7 @@ __s32 portals_debug_copy_to_user(char *buf, unsigned long len)
 
         if (debug_wrapped)
                 off = debug_off + 1;
-        else 
+        else
                 off = 0;
         copied = 0;
         list_for_each(pos, &my_pages) {
@@ -698,7 +696,7 @@ finish_partial:
                 copied += to_copy;
                 if (copied >= (debug_wrapped ? debug_size : debug_off))
                         break;
-                        
+
                 off += to_copy;
                 if (off >= debug_size) {
                         off = 0;
@@ -728,7 +726,7 @@ finish_partial:
                         break;
         }
         rc = copied;
-        
+
 cleanup:
         list_for_each_safe(pos, n, &my_pages) {
                 page = list_entry(pos, struct page, list);
@@ -786,8 +784,8 @@ portals_debug_msg(int subsys, int mask, char *file, const char *fn,
         max_nob = debug_size - debug_off + DEBUG_OVERFLOW;
         if (max_nob <= 0) {
                 spin_unlock_irqrestore(&portals_debug_lock, flags);
-                printk("LustreError: logic error in portals_debug_msg: <0 bytes"
-                       " to write\n");
+                printk("LustreError: logic error in portals_debug_msg: "
+                       "< 0 bytes to write\n");
                 return;
         }
 
@@ -831,11 +829,15 @@ portals_debug_msg(int subsys, int mask, char *file, const char *fn,
         if ((mask & D_EMERG) != 0)
                 printk(KERN_EMERG "LustreError: %s",
                        debug_buf + debug_off + prefix_nob);
-        if ((mask & D_ERROR) != 0)
-                printk(KERN_ERR   "LustreError: %s",
+        else if ((mask & D_ERROR) != 0)
+                printk(KERN_ERR "LustreError: %s",
+                       debug_buf + debug_off + prefix_nob);
+        else if ((mask & D_WARNING) != 0)
+                printk(KERN_WARNING "Lustre: %s",
                        debug_buf + debug_off + prefix_nob);
         else if (portal_printk)
-                printk("<%d>LustreError: %s", portal_printk, debug_buf+debug_off+prefix_nob);
+                printk("<%d>Lustre: %s", portal_printk,
+                       debug_buf+debug_off+prefix_nob);
         base_offset = debug_off & 0xFFFF;
 
         debug_off += prefix_nob + msg_nob;
@@ -878,7 +880,7 @@ void portals_run_upcall(char **argv)
                 argc++;
 
         LASSERT(argc >= 2);
-        
+
         rc = USERMODEHELPER(argv[0], argv, envp);
         if (rc < 0) {
                 CERROR("Error %d invoking portals upcall %s %s%s%s%s%s%s%s%s; "