X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-abi.c;h=775f141714724224c4178e2288acda5da2c66101;hb=b01155bac7199bfef02b9bc06e85421c28859626;hp=1b08b3b7412270ff2199ab3d3bde1e379ca23370;hpb=db2511b4c306a7d8b3a6f81f4741ab6a318490d5;p=lttng-modules.git diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 1b08b3b7..775f1417 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; } @@ -933,6 +936,7 @@ unsigned int lttng_event_notifier_group_notif_poll(struct file *filp, const struct lib_ring_buffer_config *config = &chan->backend.config; int finalized, disabled; unsigned long consumed, offset; + size_t subbuffer_header_size = config->cb.subbuffer_header_size(); if (filp->f_mode & FMODE_READ) { poll_wait_set_exclusive(wait); @@ -960,7 +964,7 @@ retry: /* * If there is a non-empty subbuffer, flush and try again. */ - if (subbuf_offset(offset, chan) != 0) { + if (subbuf_offset(offset, chan) > subbuffer_header_size) { lib_ring_buffer_switch_remote(buf); goto retry; } @@ -1800,6 +1804,7 @@ 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: case LTTNG_KERNEL_KRETPROBE: