This changes the console error string for LND and LNET subsystem
messages to LNet or LNetError depending on the severity. This
should make it much easier to figure out where the issues are.
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ibd5f5c4cd717d2c9b6bd865e7e13258e84cda821
Reviewed-on: http://review.whamcloud.com/990
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
+static char *
+dbghdr_to_err_string(struct ptldebug_header *hdr)
+{
+ switch (hdr->ph_subsys) {
+
+ case S_LND:
+ case S_LNET:
+ return "LNetError";
+ default:
+ return "LustreError";
+ }
+}
+
+static char *
+dbghdr_to_info_string(struct ptldebug_header *hdr)
+{
+ switch (hdr->ph_subsys) {
+
+ case S_LND:
+ case S_LNET:
+ return "LNet";
+ default:
+ return "Lustre";
+ }
+}
+
void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
const char *buf, int len, const char *file,
const char *fn)
void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
const char *buf, int len, const char *file,
const char *fn)
char *prefix = "Lustre", *ptype = NULL;
if ((mask & D_EMERG) != 0) {
char *prefix = "Lustre", *ptype = NULL;
if ((mask & D_EMERG) != 0) {
- prefix = "LustreError";
+ prefix = dbghdr_to_err_string(hdr);
ptype = KERN_EMERG;
} else if ((mask & D_ERROR) != 0) {
ptype = KERN_EMERG;
} else if ((mask & D_ERROR) != 0) {
- prefix = "LustreError";
+ prefix = dbghdr_to_err_string(hdr);
ptype = KERN_ERR;
} else if ((mask & D_WARNING) != 0) {
ptype = KERN_ERR;
} else if ((mask & D_WARNING) != 0) {
+ prefix = dbghdr_to_info_string(hdr);
ptype = KERN_WARNING;
} else if ((mask & (D_CONSOLE | libcfs_printk)) != 0) {
ptype = KERN_WARNING;
} else if ((mask & (D_CONSOLE | libcfs_printk)) != 0) {
+ prefix = dbghdr_to_info_string(hdr);