X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Frelay.c;h=408ce906f82c7f0262d71c2ea59270790f82b052;hb=a2dc02e0e0a685b8814b68a2f07ce73c08e0ef50;hp=a31cdf7a1ca3ad4b6dc5ff69eeba7da8e2b88b4f;hpb=c378e5b330530ab716a1743a66d6ec9f4a2464f9;p=ust.git diff --git a/libust/relay.c b/libust/relay.c index a31cdf7..408ce90 100644 --- a/libust/relay.c +++ b/libust/relay.c @@ -22,7 +22,7 @@ //ust// #include //ust// #include //ust// #include -#include "kernelcompat.h" +#include #include #include #include @@ -268,7 +268,7 @@ static void __relay_reset(struct rchan_buf *buf, unsigned int init) //ust// init_waitqueue_head(&buf->read_wait); kref_init(&buf->kref); //ust// setup_timer(&buf->timer, wakeup_readers, (unsigned long)buf); - } else + } //ust// else //ust// del_timer_sync(&buf->timer); buf->finalized = 0; @@ -1798,13 +1798,24 @@ static inline int ltt_relay_try_reserve( - (local_read(<t_buf->commit_count[subbuf_index]) & ltt_channel->commit_count_mask); if (offsets->reserve_commit_diff == 0) { + long consumed; + + consumed = atomic_long_read(<t_buf->consumed); + /* Next buffer not corrupted. */ if (!ltt_channel->overwrite && (SUBBUF_TRUNC(offsets->begin, buf->chan) - - SUBBUF_TRUNC(atomic_long_read( - <t_buf->consumed), - buf->chan)) + - SUBBUF_TRUNC(consumed, buf->chan)) >= rchan->alloc_size) { + + long consumed_idx = SUBBUF_INDEX(consumed, buf->chan); + long commit_count = local_read(<t_buf->commit_count[consumed_idx]); + if(((commit_count - buf->chan->subbuf_size) & ltt_channel->commit_count_mask) - (BUFFER_TRUNC(consumed, buf->chan) >> ltt_channel->n_subbufs_order) != 0) { + WARN("Event dropped. Caused by non-committed event."); + } + else { + WARN("Event dropped. Caused by non-consumed buffer."); + } /* * We do not overwrite non consumed buffers * and we are full : event is lost.