#include <lttng-abi-old.h>
#include <lttng-events.h>
#include <lttng-tracer.h>
+#include <lttng-tp-mempool.h>
#include <lib/ringbuffer/frontend_types.h>
/*
transport_name = "<unknown>";
break;
}
- if (atomic_long_add_unless(&session_file->f_count,
- 1, INT_MAX) == INT_MAX) {
+ if (!atomic_long_add_unless(&session_file->f_count, 1, LONG_MAX)) {
+ ret = -EOVERFLOW;
goto refcount_error;
}
/*
long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct lttng_session *session = file->private_data;
+ struct lttng_kernel_channel chan_param;
+ struct lttng_kernel_old_channel old_chan_param;
switch (cmd) {
case LTTNG_KERNEL_OLD_CHANNEL:
{
- struct lttng_kernel_channel chan_param;
- struct lttng_kernel_old_channel old_chan_param;
-
if (copy_from_user(&old_chan_param,
(struct lttng_kernel_old_channel __user *) arg,
sizeof(struct lttng_kernel_old_channel)))
}
case LTTNG_KERNEL_CHANNEL:
{
- struct lttng_kernel_channel chan_param;
-
if (copy_from_user(&chan_param,
(struct lttng_kernel_channel __user *) arg,
sizeof(struct lttng_kernel_channel)))
return lttng_session_disable(session);
case LTTNG_KERNEL_OLD_METADATA:
{
- struct lttng_kernel_channel chan_param;
- struct lttng_kernel_old_channel old_chan_param;
-
if (copy_from_user(&old_chan_param,
(struct lttng_kernel_old_channel __user *) arg,
sizeof(struct lttng_kernel_old_channel)))
}
case LTTNG_KERNEL_METADATA:
{
- struct lttng_kernel_channel chan_param;
-
if (copy_from_user(&chan_param,
(struct lttng_kernel_channel __user *) arg,
sizeof(struct lttng_kernel_channel)))
*/
return -ENOSYS;
}
+ case RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
case RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
return put_u64(stream->version, arg);
}
- 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;
}
*/
return -ENOSYS;
}
+ case RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
case RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
return put_u64(stream->version, arg);
}
- 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;
}
goto notransport;
}
- if (!lttng_kref_get(&session->metadata_cache->refcount))
+ if (!lttng_kref_get(&session->metadata_cache->refcount)) {
+ ret = -EOVERFLOW;
goto kref_error;
+ }
+
ret = lttng_abi_create_stream_fd(channel_file, stream_priv,
<tng_metadata_ring_buffer_file_operations);
if (ret < 0)
goto file_error;
}
/* The event holds a reference on the channel */
- if (atomic_long_add_unless(&channel_file->f_count,
- 1, INT_MAX) == INT_MAX) {
+ if (!atomic_long_add_unless(&channel_file->f_count, 1, LONG_MAX)) {
ret = -EOVERFLOW;
goto refcount_error;
}
wrapper_vmalloc_sync_all();
lttng_clock_ref();
+
+ ret = lttng_tp_mempool_init();
+ if (ret) {
+ goto error;
+ }
+
lttng_proc_dentry = proc_create_data("lttng", S_IRUSR | S_IWUSR, NULL,
<tng_fops, NULL);
return 0;
error:
+ lttng_tp_mempool_destroy();
lttng_clock_unref();
return ret;
}
/* No __exit annotation because used by init error path too. */
void lttng_abi_exit(void)
{
+ lttng_tp_mempool_destroy();
lttng_clock_unref();
if (lttng_proc_dentry)
remove_proc_entry("lttng", NULL);