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;
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;
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:
return -EINVAL;
CDEBUG(0, "********************************************************\n");
- CERROR("DEBUG MARKER: %s\n", text);
+ CWARN("DEBUG MARKER: %s\n", text);
CDEBUG(0, "********************************************************\n");
return 0;
}
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);
if (debug_wrapped)
off = debug_off + 1;
- else
+ else
off = 0;
copied = 0;
list_for_each(pos, &my_pages) {
copied += to_copy;
if (copied >= (debug_wrapped ? debug_size : debug_off))
break;
-
+
off += to_copy;
if (off >= debug_size) {
off = 0;
break;
}
rc = copied;
-
+
cleanup:
list_for_each_safe(pos, n, &my_pages) {
page = list_entry(pos, struct page, list);
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;
}
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;
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; "
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;
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;
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:
return -EINVAL;
CDEBUG(0, "********************************************************\n");
- CERROR("DEBUG MARKER: %s\n", text);
+ CWARN("DEBUG MARKER: %s\n", text);
CDEBUG(0, "********************************************************\n");
return 0;
}
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);
if (debug_wrapped)
off = debug_off + 1;
- else
+ else
off = 0;
copied = 0;
list_for_each(pos, &my_pages) {
copied += to_copy;
if (copied >= (debug_wrapped ? debug_size : debug_off))
break;
-
+
off += to_copy;
if (off >= debug_size) {
off = 0;
break;
}
rc = copied;
-
+
cleanup:
list_for_each_safe(pos, n, &my_pages) {
page = list_entry(pos, struct page, list);
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;
}
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;
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; "