#define _GNU_SOURCE
#define LTT_TRACE
#define LTT_TRACE_FAST
-#include <sys/types.h>
-#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <malloc.h>
#include <string.h>
-#include <sys/mman.h>
#include <signal.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <errno.h>
#include <sys/param.h>
#include <sys/time.h>
-#include <errno.h>
-
-#include <asm/atomic.h>
-#include <asm/timex.h> //for get_cycles()
-
-_syscall0(pid_t,gettid)
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <sys/syscall.h>
#include <ltt/ltt-usertrace.h>
+#define gettid() syscall(__NR_gettid)
+
#ifdef LTT_SHOW_DEBUG
#define dbg_printf(...) printf(__VA_ARGS__)
#else
index in the buffer being the one which will win this loop. */
/* If the buffer is not in overwrite mode, pushing the reader only
happen if a sub-buffer is corrupted */
- if((SUBBUF_TRUNC(offset_end, ltt_buf)
+ if((SUBBUF_TRUNC(offset_end-1, ltt_buf)
- SUBBUF_TRUNC(consumed_old, ltt_buf))
>= ltt_buf->alloc_size)
consumed_new = SUBBUF_ALIGN(consumed_old, ltt_buf);
printf("error in sem_post");
}
}
+ return ret;
}
static int read_subbuffer(struct ltt_buf *ltt_buf, int fd)