[lttng-dev] [ltt-dev] Flight-recording mode

Gerlando Falauto gerlando.falauto at keymile.com
Thu Dec 15 15:35:41 EST 2011


On 11/10/2011 09:06 AM, Gerlando Falauto wrote:
> On 10/28/2011 09:39 AM, Mathieu Desnoyers wrote:
>> * Gerlando Falauto (gerlando.falauto at keymile.com) 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



More information about the lttng-dev mailing list