Fix tabbing.... Please fix your editors so they do tabbing correctly!!! (Spaces...
[IRC.git] / Robust / src / Runtime / DSTM / interface / dsmdebug.h
1 #ifndef _DSMDEBUG_H_
2 #define _DSMDEBUG_H_
3
4 #include <sys/time.h>
5
6 #define TABORT1(s) {printf("%s\n", s); fflush(stdout); }
7 #define TABORT2(s, msg) {printf("%s(): %s\n", s, msg); fflush(stdout); }
8 #define TABORT3(func, s, msg, d) {printf("%s(): %s: for %s = %d\n", func, s, msg, d); fflush(stdout); }
9 #define TABORT4(s, d) {printf("%s = %d\n", s, d); fflush(stdout); }
10 #define TABORT5(func, msg1, msg2, val1, val2) {printf("%s(): %s = %x, %s = %d\n", func, msg1, val1, msg2, val2); fflush(stdout); }
11 #define TABORT6(a, b, c, val1, val2) {printf("%s = %x, %s for %s = %x\n", a, val1, b, c, val2); fflush(stdout); }
12 #define TABORT7(func, a, b, c, val1, val2) {printf("%s(): %s for %s =%d, %s = %x\n", func, a, b, val1, c, val2); fflush(stdout); }
13 #define TABORT8(func, s, d) {printf("%s(): %s = %d\n", func, s, d); fflush(stdout); }
14 #define TABORT9(func, a, b, c, d, val1, val2, val3) {printf("%s(): %s for %s =%x, %s = %d, %s = %x\n", func, a, b, val1, c, val2, d, val3); fflush(stdout); }
15
16 #define ARRAY_SIZE 10100
17 #define GETSTARTDELAY(start, count) { \
18     struct timeval tv; \
19     count++; \
20     gettimeofday(&tv, NULL); \
21     start = tv.tv_sec+(tv.tv_usec/1000000.0); \
22 }
23
24 #define GETSTART(start) { \
25     struct timeval tv; \
26     gettimeofday(&tv, NULL); \
27     start = tv.tv_sec+(tv.tv_usec/1000000.0); \
28 }
29
30 #define GETENDDELAY(start, end, time) { \
31     struct timeval tv; \
32     gettimeofday(&tv, NULL); \
33     end = tv.tv_sec+(tv.tv_usec/1000000.0); \
34     time = (end-start); \
35 }
36
37 #endif