On 11/10/2011 09:06 AM, Gerlando Falauto wrote:
On 10/28/2011 09:39 AM, Mathieu Desnoyers wrote:
* Gerlando Falauto ([email protected]) wrote:
[...]
How can I make sure that only the latest N seconds of traces will be
saved? The answer should be flight-recording mode, but how do I really
do it?

I discussed this with David this morning, and we'll need to enhance
ltt-sessiond in lttng-tools to ensure it does not send the streams to
the consumer daemon upon trace start for overwrite mode channels, but
just on trace stop. This is lacking currently.

Thanks for reporting this!


Would the following one-line patch do the trick?
It kinda-maybe-seems-to-sorta-work for me...

diff --git a/lib/ringbuffer/ring_buffer_vfs.c b/lib/ringbuffer/ring_buffer_vfs.c
index 8b78305..7676688 100644
--- a/lib/ringbuffer/ring_buffer_vfs.c
+++ b/lib/ringbuffer/ring_buffer_vfs.c
@@ -123,7 +123,7 @@ retry:
                                else
                                        return 0;
                        }
-               } else {
+ } else if (config->mode != RING_BUFFER_OVERWRITE || finalized) { if (subbuf_trunc(lib_ring_buffer_get_offset(config, buf),
                                         chan)
- subbuf_trunc(lib_ring_buffer_get_consumed(config, buf),


Thanks!
Gerlando

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to