]> git.lttng.org Git - lttng-ust.git/commitdiff
Documentation: ring buffer: SWITCH_FLUSH can be used when active
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 May 2016 14:06:45 +0000 (10:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 May 2016 19:25:22 +0000 (15:25 -0400)
Snapshot mode tracing may use SWITCH_FLUSH while tracing is active.

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

index 6c3fa740ba397ea005f605e998ffb1ce5f175e5e..7136abbc3b3ac84cd3adb94c7c63ef2e95a3356b 100644 (file)
@@ -1386,7 +1386,8 @@ void lib_ring_buffer_print_errors(struct channel *chan,
 /*
  * lib_ring_buffer_switch_old_start: Populate old subbuffer header.
  *
- * Only executed when the buffer is finalized, in SWITCH_FLUSH.
+ * Only executed by SWITCH_FLUSH, which can be issued while tracing is
+ * active or at buffer finalization (destroy).
  */
 static
 void lib_ring_buffer_switch_old_start(struct lttng_ust_lib_ring_buffer *buf,
@@ -1560,12 +1561,14 @@ int lib_ring_buffer_try_switch_slow(enum switch_mode mode,
                unsigned long sb_index, commit_count;
 
                /*
-                * We are performing a SWITCH_FLUSH. At this stage, there are no
-                * concurrent writes into the buffer.
+                * 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.
                 *
-                * 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 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.
                 */
                if (!config->cb.subbuffer_header_size())
                        return -1;
This page took 0.030804 seconds and 4 git commands to generate.