Version 2.7.7
[lttng-modules.git] / lttng-abi.c
index b51434a17a9e28aee7de71f24437511f31e3bb55..9400f5374aad7ce1510e7db59bcc423568b50448 100644 (file)
@@ -684,6 +684,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;
        }
@@ -739,6 +751,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;
        }
@@ -993,6 +1032,7 @@ int lttng_abi_create_event(struct file *channel_file,
        /* The event holds a reference on the channel */
        if (atomic_long_add_unless(&channel_file->f_count,
                1, INT_MAX) == INT_MAX) {
+               ret = -EOVERFLOW;
                goto refcount_error;
        }
        if (event_param->instrumentation == LTTNG_KERNEL_TRACEPOINT
This page took 0.023953 seconds and 4 git commands to generate.