X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=0f01d3d7df558b3ad6515edddc5006d865693d8b;hb=de9b16cda94d0e1cab5f9980f2a699e2b2fb93a1;hp=bdc6c7660601761bc42b999a3e99b5515916e6e2;hpb=afbb7f1f732082fea302d5c821b8b67fae445e2b;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index bdc6c766..0f01d3d7 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -629,6 +629,18 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, goto err; break; } + 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; } @@ -684,6 +696,33 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, */ return -ENOSYS; } + case RING_BUFFER_FLUSH: + { + struct lttng_metadata_stream *stream = filp->private_data; + struct lib_ring_buffer *buf = stream->priv; + struct channel *chan = buf->backend.chan; + + /* + * Before doing the actual ring buffer flush, write up to one + * packet of metadata in the ring buffer. + */ + ret = lttng_metadata_output_channel(stream, chan); + if (ret < 0) + goto err; + break; + } + 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; }