X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=libust%2Frelay.c;h=f975c54c3603298939086711e396070907fda4c3;hb=c0c87f09b7763485b837b35f1f28291a3fd3caa9;hp=a31cdf7a1ca3ad4b6dc5ff69eeba7da8e2b88b4f;hpb=c378e5b330530ab716a1743a66d6ec9f4a2464f9;p=ust.git diff --git a/libust/relay.c b/libust/relay.c index a31cdf7..f975c54 100644 --- a/libust/relay.c +++ b/libust/relay.c @@ -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.