From: James Simmons Date: Mon, 5 Mar 2012 14:28:48 +0000 (-0500) Subject: LU-444 lnet: Add LNetError for S_LND and S_LNET X-Git-Tag: 2.2.51~34 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c9866d01d009fedc530fb1842486d556a2b5e067 LU-444 lnet: Add LNetError for S_LND and S_LNET 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 Change-Id: Ibd5f5c4cd717d2c9b6bd865e7e13258e84cda821 Reviewed-on: http://review.whamcloud.com/990 Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam Tested-by: Hudson Tested-by: Maloo --- diff --git a/libcfs/libcfs/linux/linux-tracefile.c b/libcfs/libcfs/linux/linux-tracefile.c index 51d7d7f..7b499f8 100644 --- a/libcfs/libcfs/linux/linux-tracefile.c +++ b/libcfs/libcfs/linux/linux-tracefile.c @@ -202,6 +202,32 @@ cfs_set_ptldebug_header(struct ptldebug_header *header, return; } +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) @@ -209,16 +235,16 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask, 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) { - prefix = "LustreError"; + prefix = dbghdr_to_err_string(hdr); ptype = KERN_ERR; } else if ((mask & D_WARNING) != 0) { - prefix = "Lustre"; + prefix = dbghdr_to_info_string(hdr); ptype = KERN_WARNING; } else if ((mask & (D_CONSOLE | libcfs_printk)) != 0) { - prefix = "Lustre"; + prefix = dbghdr_to_info_string(hdr); ptype = KERN_INFO; }