X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=196aed84e421fa96708e13e247aee2277b255485;hb=1150bcb59992634f385fe65cd83bce4a8003f094;hp=6993a46fb740039d22a647d1b13fef567b70dbc6;hpb=9a0aa3b1fd7f693fc14b29cce9eb07cd275b0347;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index 6993a46f..196aed84 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -684,6 +684,21 @@ 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; + } default: break; } @@ -1234,8 +1249,8 @@ int lttng_metadata_channel_release(struct inode *inode, struct file *file) struct lttng_channel *channel = file->private_data; if (channel) { - lttng_metadata_channel_destroy(channel); fput(channel->session->file); + lttng_metadata_channel_destroy(channel); } return 0;