fix 64 bits
[lttv.git] / ltt-usertrace / ltt / ltt-usertrace-fast.h
index 45b8b6c0cf805abbd24fa4de3dcdbba331068fa5..b0b0ea5cdceaaa1562ed29df1b9b73efd4036254 100644 (file)
@@ -9,9 +9,9 @@
 #define _LTT_USERTRACE_FAST_H
 
 #ifdef LTT_TRACE
+#ifdef LTT_TRACE_FAST
 
 #include <errno.h>
-#include <asm/atomic.h>
 #include <pthread.h>
 #include <stdint.h>
 #include <syscall.h>
@@ -20,7 +20,6 @@
 #include <signal.h>
 
 #include <ltt/ltt-facility-id-user_generic.h>
-#include <ltt/ltt-generic.h>
 
 #ifndef        LTT_N_SUBBUFS
 #define LTT_N_SUBBUFS 2
@@ -57,8 +56,6 @@
 #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
 #endif //atomic_cmpxchg
 
-typedef unsigned int ltt_facility_t;
-       
 struct ltt_trace_header {
        uint32_t                                magic_number;
        uint32_t                                arch_type;
@@ -352,7 +349,7 @@ static inline void * __attribute__((no_instrument_function)) ltt_reserve_slot(
                                                                                                                        struct ltt_trace_info *trace,
                                                                                                                        struct ltt_buf *ltt_buf,
                                                                                                                        unsigned int data_size,
-                                                                                                                       unsigned int *slot_size,
+                                                                                                                       size_t *slot_size,
                                                                                                                        uint64_t *tsc,
                                                                                                                        size_t *before_hdr_pad,
                                                                                                                        size_t *after_hdr_pad,
@@ -478,7 +475,7 @@ static inline void * __attribute__((no_instrument_function)) ltt_reserve_slot(
                         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);
@@ -628,7 +625,6 @@ static inline void __attribute__((no_instrument_function)) ltt_commit_slot(
 }
        
 
+#endif //LTT_TRACE_FAST
 #endif //LTT_TRACE
-
-
 #endif //_LTT_USERTRACE_FAST_H
This page took 0.034188 seconds and 4 git commands to generate.