Revert "Fix: don't perform extra flush on metadata channel"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 May 2017 20:42:34 +0000 (16:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 11 May 2017 21:47:58 +0000 (17:47 -0400)
This reverts commit 7cf44d034bdda1896f6b0c6374c90c06d45ee4fd.

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

index 88820f7e5c0c04d6b66255e38524c59b760e70a2..3a229ff8f9b6e73d16fcb60e4b7124728033d01f 100644 (file)
@@ -168,9 +168,6 @@ void lib_ring_buffer_check_deliver_slow(const struct lib_ring_buffer_config *con
 extern
 void lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf);
 
-extern
-void lib_ring_buffer_switch_remote_empty(struct lib_ring_buffer *buf);
-
 /* Buffer write helpers */
 
 static inline
index 68b62382e9fc87c2a307887cc67e144dfe1528a8..8a6a1883a96dfa8ed923c7c48678a1f1a3f8b201 100644 (file)
@@ -1075,6 +1075,15 @@ 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);
        /*
@@ -1839,13 +1848,6 @@ void lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf)
 }
 EXPORT_SYMBOL_GPL(lib_ring_buffer_switch_remote);
 
-/* Switch sub-buffer even if current sub-buffer is empty. */
-void lib_ring_buffer_switch_remote_empty(struct lib_ring_buffer *buf)
-{
-       _lib_ring_buffer_switch_remote(buf, SWITCH_FLUSH);
-}
-EXPORT_SYMBOL_GPL(lib_ring_buffer_switch_remote_empty);
-
 /*
  * Returns :
  * 0 if ok
index 15da212d3fa313e3b3a027b2638132cacbb1db40..f1a8bab781cd2f5829c552067eefdb2365c1f2e7 100644 (file)
@@ -191,15 +191,6 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd,
 
        switch (cmd) {
        case RING_BUFFER_SNAPSHOT:
-               /*
-                * 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_empty(buf);
                return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot,
                                            &buf->prod_snapshot);
        case RING_BUFFER_SNAPSHOT_GET_CONSUMED:
@@ -329,15 +320,6 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd,
 
        switch (cmd) {
        case RING_BUFFER_COMPAT_SNAPSHOT:
-               /*
-                * 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_empty(buf);
                return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot,
                                                &buf->prod_snapshot);
        case RING_BUFFER_COMPAT_SNAPSHOT_GET_CONSUMED:
index 478a5912f89a0ebee71185885119bd3d85e1aff1..3e4a88c1f83b74ab77f08b52493943d2d3035ef0 100644 (file)
@@ -704,18 +704,6 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
 
                return put_u64(stream->version, arg);
        }
-       case RING_BUFFER_SNAPSHOT:
-       {
-               /*
-                * Force the buffer to quiescent so the ring buffer
-                * don't attempt to perform a SWITCH_FLUSH, which would
-                * desynchronize the client accounting of the amount of
-                * data available in the buffer from the ring buffer
-                * view.
-                */
-               buf->quiescent = true;
-               break;
-       }
        default:
                break;
        }
@@ -792,18 +780,6 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
 
                return put_u64(stream->version, arg);
        }
-       case RING_BUFFER_SNAPSHOT:
-       {
-               /*
-                * Force the buffer to quiescent so the ring buffer
-                * don't attempt to perform a SWITCH_FLUSH, which would
-                * desynchronize the client accounting of the amount of
-                * data available in the buffer from the ring buffer
-                * view.
-                */
-               buf->quiescent = true;
-               break;
-       }
        default:
                break;
        }
This page took 0.029146 seconds and 4 git commands to generate.