Force 64-bit timestamps
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 23 Jan 2012 17:06:06 +0000 (12:06 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 23 Jan 2012 17:06:06 +0000 (12:06 -0500)
commit 9080554ff25b08f48762d2ee7cfa3981317e9c1d attempted to fix the
timestamp problem by using large event headers. It incorrectly stated
that those headers "use a 64-bit timestamp field". In fact, they use a
32-bit timestamp field (not 64). So they were helping (it was better
than using a 27-bit field), but the problem could still appear. It's
only when the RING_BUFFER_RFLAG_FULL_TSC is set that the ring buffer
forces use of the 64-bit fields.

Fix this for good by setting this flag.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/ltt-events.c
liblttng-ust/ltt-ring-buffer-client.h
libringbuffer/frontend_api.h

index ee88b43142d6e39c57f974102ba45328a7aef210..9751089c564f6830cb449eceb084200593dab2ae 100644 (file)
@@ -309,20 +309,10 @@ int ltt_session_enable(struct ltt_session *session)
        cds_list_for_each_entry(chan, &session->chan, list) {
                if (chan->header_type)
                        continue;               /* don't change it if session stop/restart */
-               /*
-                * Because we don't use any timer in the application, we
-                * currently cannot guarantee that we have frequent
-                * events that let us detect 27-bit overflows.
-                * Therefore, for now, we force large event headers,
-                * which contain 64-bit timestamps.
-                */
-               chan->header_type = 2;  /* large */
-#if 0
                if (chan->free_event_id < 31)
                        chan->header_type = 1;  /* compact */
                else
                        chan->header_type = 2;  /* large */
-#endif //0
        }
 
        CMM_ACCESS_ONCE(session->active) = 1;
index a2ace400d608824dac0bb9be198d968d6e0561da..b180b793668882842bfa793b782529e01cf258c7 100644 (file)
@@ -365,7 +365,7 @@ static const struct lttng_ust_lib_ring_buffer_config client_config = {
        .cb.buffer_create = client_buffer_create,
        .cb.buffer_finalize = client_buffer_finalize,
 
-       .tsc_bits = 32,
+       .tsc_bits = 27,
        .alloc = RING_BUFFER_ALLOC_PER_CPU,
        .sync = RING_BUFFER_SYNC_GLOBAL,
        .mode = RING_BUFFER_MODE_TEMPLATE,
index 49f6e4c27274a32c2c59b05e414714b780770b9e..d5a2f2a043cb892a0ef020bfd7ef9b137978debb 100644 (file)
@@ -93,8 +93,18 @@ int lib_ring_buffer_try_reserve(const struct lttng_ust_lib_ring_buffer_config *c
         */
        //prefetch(&buf->commit_hot[subbuf_index(*o_begin, chan)]);
 
+       /*
+        * Because we don't use any timer in the application, we
+        * currently cannot guarantee that we have frequent
+        * events that let us detect 27-bit overflows.
+        * Therefore, for now, we force event headers
+        * to contain 64-bit timestamps.
+        */
+       ctx->rflags |= RING_BUFFER_RFLAG_FULL_TSC;
+#if 0
        if (last_tsc_overflow(config, buf, ctx->tsc))
                ctx->rflags |= RING_BUFFER_RFLAG_FULL_TSC;
+#endif //0
 
        if (caa_unlikely(subbuf_offset(*o_begin, chan) == 0))
                return 1;
This page took 0.03258 seconds and 4 git commands to generate.