Revert "Fix: flush empty packets on snapshot channel"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 May 2017 20:42:46 +0000 (16:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 May 2017 21:47:52 +0000 (17:47 -0400)
This reverts commit dc5cd5702b74d72f0db0141c6d888a1d820aed9c.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_frontend.c

index e454ac97c168ac6ea6671c01b80ffda03c13c17c..8257dcc63867410291d2dd7bf07ab176449edc3b 100644 (file)
@@ -1075,15 +1075,6 @@ int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf,
        unsigned long consumed_cur, write_offset;
        int finalized;
 
-       /*
-        * First, ensure we perform a "final" flush onto the stream.  This will
-        * ensure we create a packet of padding if we encounter an empty
-        * packet. This ensures the time-stamps right before the snapshot is
-        * used as end of packet timestamp.
-        */
-       if (!buf->quiescent)
-               _lib_ring_buffer_switch_remote(buf, SWITCH_FLUSH);
-
 retry:
        finalized = ACCESS_ONCE(buf->finalized);
        /*
@@ -1504,8 +1495,7 @@ void lib_ring_buffer_print_errors(struct channel *chan,
 /*
  * lib_ring_buffer_switch_old_start: Populate old subbuffer header.
  *
- * Only executed by SWITCH_FLUSH, which can be issued while tracing is active
- * or at buffer finalization (destroy).
+ * Only executed when the buffer is finalized, in SWITCH_FLUSH.
  */
 static
 void lib_ring_buffer_switch_old_start(struct lib_ring_buffer *buf,
@@ -1701,14 +1691,12 @@ int lib_ring_buffer_try_switch_slow(enum switch_mode mode,
                unsigned long sb_index, commit_count;
 
                /*
-                * We are performing a SWITCH_FLUSH. There may be concurrent
-                * writes into the buffer if e.g. invoked while performing a
-                * snapshot on an active trace.
+                * We are performing a SWITCH_FLUSH. At this stage, there are no
+                * concurrent writes into the buffer.
                 *
-                * If the client does not save any header information (sub-buffer
-                * header size == 0), don't switch empty subbuffer on finalize,
-                * because it is invalid to deliver a completely empty
-                * subbuffer.
+                * The client does not save any header information.  Don't
+                * switch empty subbuffer on finalize, because it is invalid to
+                * deliver a completely empty subbuffer.
                 */
                if (!config->cb.subbuffer_header_size())
                        return -1;
This page took 0.027185 seconds and 4 git commands to generate.