X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-abi.c;h=a57e5e9f2acb699c899bba2fc2e1ccc5797be053;hb=24400611af9c953006017ace73900a9af8f1ccd9;hp=4dd9273f1eb9a0551d343dfd7706b0893f45fb2d;hpb=7cf44d034bdda1896f6b0c6374c90c06d45ee4fd;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index 4dd9273f..a57e5e9f 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -51,10 +51,12 @@ #include #include #include +#include #include #include #include #include +#include #include /* @@ -396,7 +398,7 @@ int lttng_abi_create_channel(struct file *session_file, fops = <tng_metadata_fops; break; } - + chan_file = anon_inode_getfile("[lttng_channel]", fops, NULL, O_RDWR); @@ -569,6 +571,8 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return lttng_session_list_tracker_pids(session); case LTTNG_KERNEL_SESSION_METADATA_REGEN: return lttng_session_metadata_regenerate(session); + case LTTNG_KERNEL_SESSION_STATEDUMP: + return lttng_session_statedump(session); default: return -ENOIOCTLCMD; } @@ -681,6 +685,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, */ return -ENOSYS; } + case RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ case RING_BUFFER_FLUSH: { struct lttng_metadata_stream *stream = filp->private_data; @@ -702,18 +707,6 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, 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; } @@ -769,6 +762,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, */ return -ENOSYS; } + case RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */ case RING_BUFFER_FLUSH: { struct lttng_metadata_stream *stream = filp->private_data; @@ -790,18 +784,6 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, 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; } @@ -996,8 +978,11 @@ int lttng_abi_open_metadata_stream(struct file *channel_file) 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) @@ -1063,8 +1048,12 @@ int lttng_abi_create_event(struct file *channel_file, || event_param->instrumentation == LTTNG_KERNEL_SYSCALL) { struct lttng_enabler *enabler; - if (event_param->name[strlen(event_param->name) - 1] == '*') { - enabler = lttng_enabler_create(LTTNG_ENABLER_WILDCARD, + if (strutils_is_star_glob_pattern(event_param->name)) { + /* + * If the event name is a star globbing pattern, + * we create the special star globbing enabler. + */ + enabler = lttng_enabler_create(LTTNG_ENABLER_STAR_GLOB, event_param, channel); } else { enabler = lttng_enabler_create(LTTNG_ENABLER_NAME, @@ -1739,9 +1728,15 @@ int __init lttng_abi_init(void) 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); - + if (!lttng_proc_dentry) { printk(KERN_ERR "Error creating LTTng control file\n"); ret = -ENOMEM; @@ -1751,6 +1746,7 @@ int __init lttng_abi_init(void) return 0; error: + lttng_tp_mempool_destroy(); lttng_clock_unref(); return ret; } @@ -1758,6 +1754,7 @@ error: /* 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);