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

Davis, Arlin R arlin.r.davis at intel.com
Mon May 18 12:47:56 PDT 2009


>please copy the ofw mail list on dapl changes

ok

>Maybe add a new call, dapl_os_get_thread_id or something 
>similar, to avoid
>confusion with the name and what the call returns.

What about this...

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

 #endif /*  _DAPL_OSD_H_ */



More information about the ofw mailing list