X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt-usertrace%2Fltt-usertrace-fast.c;h=f97e941e5e12b2d97e80c9abb52602ee393a656e;hb=4ebfe6f94bbf97a09b1d78df68a967ffdee085d0;hp=1364d3bb6a0a15c1fa0f15620ffccf2b104ba116;hpb=c095a20dabdd46c25735500a42acf002b82dbe56;p=lttv.git diff --git a/ltt-usertrace/ltt-usertrace-fast.c b/ltt-usertrace/ltt-usertrace-fast.c index 1364d3bb..f97e941e 100644 --- a/ltt-usertrace/ltt-usertrace-fast.c +++ b/ltt-usertrace/ltt-usertrace-fast.c @@ -46,8 +46,6 @@ #define _GNU_SOURCE #define LTT_TRACE #define LTT_TRACE_FAST -#include -#include #include #include #include @@ -57,22 +55,23 @@ #include #include #include -#include #include -#include #include #include +#include #include #include -#include - -#include -#include //for get_cycles() - -_syscall0(pid_t,gettid) +#include +#include +#include +#include +#include +#include #include +#define gettid() syscall(__NR_gettid) + #ifdef LTT_SHOW_DEBUG #define dbg_printf(...) printf(__VA_ARGS__) #else @@ -205,7 +204,7 @@ static void flush_buffer(struct ltt_buf *ltt_buf, enum force_switch_mode mode) 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); @@ -369,6 +368,7 @@ static inline int ltt_buffer_put(struct ltt_buf *ltt_buf, printf("error in sem_post"); } } + return ret; } static int read_subbuffer(struct ltt_buf *ltt_buf, int fd)