X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fring_buffer_frontend.c;h=9cd62ced16ae19deedd8eea935c507e09cd5616a;hb=7cf44d034bdda1896f6b0c6374c90c06d45ee4fd;hp=017d30f5ddf673c36f2932d2fe83581a35bea50c;hpb=a6370148ab4a6f210c29372febcffd87b440cc50;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index 017d30f5..9cd62ced 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -904,15 +904,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); /* @@ -1663,6 +1654,13 @@ 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