parlib: Make I_AM_HERE more verbose
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 20 Jan 2017 22:08:00 +0000 (17:08 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 20 Jan 2017 22:08:00 +0000 (17:08 -0500)
It's nice to know the PID, and also to rely less on glibc.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/include/parlib/ros_debug.h

index 059dadb..8962fab 100644 (file)
@@ -4,17 +4,21 @@
 #include <parlib/parlib.h>
 #include <parlib/vcore.h>
 #include <unistd.h>
+#include <sys/types.h>
+#include <unistd.h>
 
 __BEGIN_DECLS
 
-#define I_AM_HERE printf("Vcore %d is in %s() at %s:%d\n", vcore_id(), \
-                         __FUNCTION__, __FILE__, __LINE__);
-
 #define debug_printf(...) {                                                    \
        char buf[128];                                                             \
        int ret = snprintf(buf, sizeof(buf), __VA_ARGS__);                         \
        write(2, buf, ret);                                                        \
 }
+
+#define I_AM_HERE debug_printf("PID %d, vcore %d is in %s() at %s:%d\n",       \
+                               getpid(), vcore_id(), __FUNCTION__, __FILE__,   \
+                               __LINE__);
+
 void trace_printf(const char *fmt, ...);
 
 /* For a poor-mans function tracer (can add these with spatch) */