X-Git-Url: http://git.lttng.org/?p=lttng-modules.git;a=blobdiff_plain;f=lttng-abi.c;h=77e5e9859e7f51099964f4002b932faf98531984;hp=4dd9273f1eb9a0551d343dfd7706b0893f45fb2d;hb=7ceeb15de1454896381ca45f68151211de6eff6c;hpb=7cf44d034bdda1896f6b0c6374c90c06d45ee4fd diff --git a/lttng-abi.c b/lttng-abi.c index 4dd9273f..77e5e985 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -396,7 +397,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 +570,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 +684,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 +706,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 +761,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 +783,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 +977,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 +1047,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, @@ -1741,7 +1729,7 @@ int __init lttng_abi_init(void) lttng_clock_ref(); 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;