X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-abi.c;h=1407d41bd218de7685fceaa677770f189fb3e437;hb=6bc65de7e6778e258ac1d9b8bf4b33a38a1e0f92;hp=09e437884c8e54971dad9597d6f517cb8cf660fc;hpb=18f12d55db4f9c78bde2738931a45557050858eb;p=lttng-modules.git diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 09e43788..1407d41b 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -909,11 +909,14 @@ skip_get_next: } read_count += copy_len; } - return read_count; + goto put_record; nodata: *ppos = 0; chan->iter.len_left = 0; + +put_record: + lib_ring_buffer_put_current_record(buf); return read_count; } @@ -1708,6 +1711,7 @@ fd_error: static long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { + struct lttng_event_notifier *event_notifier; struct lttng_event_notifier_enabler *event_notifier_enabler; enum lttng_event_type *evtype = file->private_data; @@ -1715,7 +1719,8 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo case LTTNG_KERNEL_ENABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: - return -EINVAL; + event_notifier = file->private_data; + return lttng_event_notifier_enable(event_notifier); case LTTNG_TYPE_ENABLER: event_notifier_enabler = file->private_data; return lttng_event_notifier_enabler_enable(event_notifier_enabler); @@ -1726,7 +1731,8 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo case LTTNG_KERNEL_DISABLE: switch (*evtype) { case LTTNG_TYPE_EVENT: - return -EINVAL; + event_notifier = file->private_data; + return lttng_event_notifier_disable(event_notifier); case LTTNG_TYPE_ENABLER: event_notifier_enabler = file->private_data; return lttng_event_notifier_enabler_disable(event_notifier_enabler); @@ -1801,9 +1807,13 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file, switch (event_notifier_param->event.instrumentation) { case LTTNG_KERNEL_TRACEPOINT: + break; case LTTNG_KERNEL_KPROBE: - case LTTNG_KERNEL_UPROBE: + event_notifier_param->event.u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; + break; case LTTNG_KERNEL_KRETPROBE: + /* Placing a trigger on kretprobe is not supported. */ + case LTTNG_KERNEL_UPROBE: case LTTNG_KERNEL_FUNCTION: case LTTNG_KERNEL_NOOP: case LTTNG_KERNEL_SYSCALL: