[ofa-general] [PATCH] uDAPL (v2.0) linux_osd: use pthread_self instead of getpid for debug messages

Sean Hefty sean.hefty at intel.com
Mon May 18 13:14:19 PDT 2009


>diff --git a/dapl/common/dapl_debug.c b/dapl/common/dapl_debug.c
>index 20ee405..6c6eeb5 100644
>--- a/dapl/common/dapl_debug.c
>+++ b/dapl/common/dapl_debug.c
>@@ -50,7 +50,7 @@ void dapl_internal_dbg_log(DAPL_DBG_TYPE type, const char
>*fmt, ...)
>                if (DAPL_DBG_DEST_STDOUT & g_dapl_dbg_dest) {
>                        va_start(args, fmt);
>                        fprintf(stdout, "%s:%lx: ", _ptr_host_,
>-                               dapl_os_getpid());
>+                               dapl_os_gettid());
>                        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 0378a70..e0e30bf 100644
>--- a/dapl/udapl/linux/dapl_osd.h
>+++ b/dapl/udapl/linux/dapl_osd.h
>@@ -572,7 +572,8 @@ 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 (long int)pthread_self
>+#define dapl_os_getpid (int)getpid
>+#define dapl_os_gettid (long int)pthread_self

That's fine - what about Windows?  :)




More information about the general mailing list