X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lib%2Fringbuffer%2Ffrontend_api.h;h=391e59377905f846b8003d2fc94fd59508198751;hb=6fb8de4b6c1e8dcc69ff6f67310c5cf29718101a;hp=d55eb33e31601658e15ca83865422be136b00fcb;hpb=f3bc08c50e1b302bceea699027d889fd6d9af525;p=lttng-modules.git diff --git a/lib/ringbuffer/frontend_api.h b/lib/ringbuffer/frontend_api.h index d55eb33e..391e5937 100644 --- a/lib/ringbuffer/frontend_api.h +++ b/lib/ringbuffer/frontend_api.h @@ -82,6 +82,8 @@ int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config, *o_old = *o_begin; ctx->tsc = lib_ring_buffer_clock_read(chan); + if ((int64_t) ctx->tsc == -EIO) + return 1; /* * Prefetch cacheline for read because we have to read the previous @@ -91,14 +93,13 @@ int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config, prefetch(&buf->commit_hot[subbuf_index(*o_begin, chan)]); if (last_tsc_overflow(config, buf, ctx->tsc)) - ctx->rflags = RING_BUFFER_RFLAG_FULL_TSC; + ctx->rflags |= RING_BUFFER_RFLAG_FULL_TSC; if (unlikely(subbuf_offset(*o_begin, chan) == 0)) return 1; ctx->slot_size = record_header_size(config, chan, *o_begin, - ctx->data_size, before_hdr_pad, - ctx->rflags, ctx); + before_hdr_pad, ctx); ctx->slot_size += lib_ring_buffer_align(*o_begin + ctx->slot_size, ctx->largest_align) + ctx->data_size; @@ -130,8 +131,12 @@ int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config, * Atomic wait-free slot reservation. The reserved space starts at the context * "pre_offset". Its length is "slot_size". The associated time-stamp is "tsc". * - * Return : -ENOSPC if not enough space, -EAGAIN if channel is disabled. - * Returns 0 on success. + * Return : + * 0 on success. + * -EAGAIN if channel is disabled. + * -ENOSPC if event size is too large for packet. + * -ENOBUFS if there is currently not enough space in buffer for the event. + * -EIO if data cannot be written into the buffer for any other reason. */ static inline