From: amrutjoshi Date: Tue, 3 Jun 2003 18:25:02 +0000 (+0000) Subject: 1) changes to debug msg format (bug 1387) X-Git-Tag: v1_7_100~1^90~42 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=427fe5e48809886fc8b9e09e377a0bb287c686de;p=fs%2Flustre-release.git 1) changes to debug msg format (bug 1387) 2) parser changes for llanalyze 3) llanalyze -logfile=filename --- diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index da54026..775d169 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -720,33 +720,34 @@ portals_debug_msg (int subsys, int mask, char *file, const char *fn, do_gettimeofday(&tv); prefix_nob = snprintf(debug_buf + debug_off, max_nob, - "%02x:%06x:%d:%lu.%06lu :", + "%02x:%06x:%d:%lu.%06lu:", subsys >> 24, mask, smp_processor_id(), tv.tv_sec, tv.tv_usec); max_nob -= prefix_nob; +#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) + msg_nob = snprintf(debug_buf + debug_off + prefix_nob, max_nob, + "%d:%d:%s():", + current->pid, current->thread.extern_pid, fn); +#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) + msg_nob = snprintf(debug_buf + debug_off + prefix_nob, max_nob, + "%d:%d:%s():", current->pid, + current->thread.mode.tt.extern_pid, fn); +#else + msg_nob = snprintf(debug_buf + debug_off + prefix_nob, max_nob, + "%d:%s():",current->pid ,fn); +#endif + max_nob -= msg_nob; if(*(format + strlen(format) - 1) == '\n') *(format + strlen(format) - 1) = ':'; va_start(ap, format); - msg_nob = vsnprintf(debug_buf + debug_off + prefix_nob , + msg_nob += vsnprintf(debug_buf + debug_off + prefix_nob + msg_nob, max_nob, format, ap); max_nob -= msg_nob; va_end(ap); -#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) msg_nob += snprintf(debug_buf + debug_off + prefix_nob + msg_nob, max_nob, - "(%s:%d:%s() %d | %d+%lu)\n", - file, line, fn, current->pid, - current->thread.extern_pid, stack); -#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - msg_nob += snprintf(debug_buf + debug_off + prefix_nob+ msg_nob, max_nob, - "(%s:%d:%s() %d | %d+%lu)\n", - file, line, fn, current->pid, - current->thread.mode.tt.extern_pid, stack); -#else - msg_nob += snprintf(debug_buf + debug_off + prefix_nob+ msg_nob, max_nob, - "(%s:%d:%s() %d+%lu)\n", - file, line, fn, current->pid, stack); -#endif + "(%s:%d %lu)\n", + file, line, stack); /* Print to console, while msg is contiguous in debug_buf */ /* NB safely terminated see above */ if ((mask & D_EMERG) != 0) diff --git a/lustre/portals/libcfs/debug.c b/lustre/portals/libcfs/debug.c index da54026..775d169 100644 --- a/lustre/portals/libcfs/debug.c +++ b/lustre/portals/libcfs/debug.c @@ -720,33 +720,34 @@ portals_debug_msg (int subsys, int mask, char *file, const char *fn, do_gettimeofday(&tv); prefix_nob = snprintf(debug_buf + debug_off, max_nob, - "%02x:%06x:%d:%lu.%06lu :", + "%02x:%06x:%d:%lu.%06lu:", subsys >> 24, mask, smp_processor_id(), tv.tv_sec, tv.tv_usec); max_nob -= prefix_nob; +#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) + msg_nob = snprintf(debug_buf + debug_off + prefix_nob, max_nob, + "%d:%d:%s():", + current->pid, current->thread.extern_pid, fn); +#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) + msg_nob = snprintf(debug_buf + debug_off + prefix_nob, max_nob, + "%d:%d:%s():", current->pid, + current->thread.mode.tt.extern_pid, fn); +#else + msg_nob = snprintf(debug_buf + debug_off + prefix_nob, max_nob, + "%d:%s():",current->pid ,fn); +#endif + max_nob -= msg_nob; if(*(format + strlen(format) - 1) == '\n') *(format + strlen(format) - 1) = ':'; va_start(ap, format); - msg_nob = vsnprintf(debug_buf + debug_off + prefix_nob , + msg_nob += vsnprintf(debug_buf + debug_off + prefix_nob + msg_nob, max_nob, format, ap); max_nob -= msg_nob; va_end(ap); -#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) msg_nob += snprintf(debug_buf + debug_off + prefix_nob + msg_nob, max_nob, - "(%s:%d:%s() %d | %d+%lu)\n", - file, line, fn, current->pid, - current->thread.extern_pid, stack); -#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - msg_nob += snprintf(debug_buf + debug_off + prefix_nob+ msg_nob, max_nob, - "(%s:%d:%s() %d | %d+%lu)\n", - file, line, fn, current->pid, - current->thread.mode.tt.extern_pid, stack); -#else - msg_nob += snprintf(debug_buf + debug_off + prefix_nob+ msg_nob, max_nob, - "(%s:%d:%s() %d+%lu)\n", - file, line, fn, current->pid, stack); -#endif + "(%s:%d %lu)\n", + file, line, stack); /* Print to console, while msg is contiguous in debug_buf */ /* NB safely terminated see above */ if ((mask & D_EMERG) != 0)