getpid provides process ids which are not unique. Use unique thread id's in debug messages to help isolate issues across many device opens with multiple CM threads.
Signed-off-by: Arlin Davis <[email protected]> --- dapl/common/dapl_debug.c | 2 +- dapl/udapl/linux/dapl_osd.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dapl/common/dapl_debug.c b/dapl/common/dapl_debug.c index ba33cfc..20ee405 100644 --- a/dapl/common/dapl_debug.c +++ b/dapl/common/dapl_debug.c @@ -49,7 +49,7 @@ void dapl_internal_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...) if (type & g_dapl_dbg_type) { if (DAPL_DBG_DEST_STDOUT & g_dapl_dbg_dest) { va_start(args, fmt); - fprintf(stdout, "%s:%d: ", _ptr_host_, + fprintf(stdout, "%s:%lx: ", _ptr_host_, dapl_os_getpid()); dapl_os_vprintf(fmt, args); va_end(args); diff --git a/dapl/udapl/linux/dapl_osd.h b/dapl/udapl/linux/dapl_osd.h index 1c098c5..0378a70 100644 --- a/dapl/udapl/linux/dapl_osd.h +++ b/dapl/udapl/linux/dapl_osd.h @@ -572,8 +572,7 @@ dapl_os_strtol(const char *nptr, char **endptr, int base) #define dapl_os_vprintf(fmt,args) vprintf(fmt,args) #define dapl_os_syslog(fmt,args) vsyslog(LOG_USER|LOG_WARNING,fmt,args) -#define dapl_os_getpid getpid - +#define dapl_os_getpid (long int)pthread_self #endif /* _DAPL_OSD_H_ */ -- 1.5.2.5 _______________________________________________ general mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
