X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Ffrontend_internal.h;h=00b9508d4df54768767fbe0aaff401cb0f965b0d;hb=ba5b4491f94109eaca10b2c285f8d1f116a38e5c;hp=8a0f78f32ee774e19e853b3c7c511957ed7adb85;hpb=1b7b0501cb18e5799d102c95592b208ca33f317a;p=lttng-ust.git diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index 8a0f78f3..00b9508d 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -446,6 +446,12 @@ void lib_ring_buffer_check_deliver(const struct lttng_ust_lib_ring_buffer_config handle), handle); + /* + * Increment the packet counter while we have exclusive + * access. + */ + subbuffer_inc_packet_count(config, &buf->backend, idx, handle); + /* * Set noref flag and offset for this subbuffer id. * Contains a memory barrier that ensures counter stores @@ -499,23 +505,20 @@ void lib_ring_buffer_write_commit_counter(const struct lttng_ust_lib_ring_buffer unsigned long idx, unsigned long buf_offset, unsigned long commit_count, - size_t slot_size, struct lttng_ust_shm_handle *handle) { - unsigned long offset, commit_seq_old; + unsigned long commit_seq_old; if (config->oops != RING_BUFFER_OOPS_CONSISTENCY) return; - offset = buf_offset + slot_size; - /* * subbuf_offset includes commit_count_mask. We can simply * compare the offsets within the subbuffer without caring about * buffer full/empty mismatch because offset is never zero here * (subbuffer header and record headers have non-zero length). */ - if (caa_unlikely(subbuf_offset(offset - commit_count, chan))) + if (caa_unlikely(subbuf_offset(buf_offset - commit_count, chan))) return; commit_seq_old = v_read(config, &shmp_index(handle, buf->commit_hot, idx)->seq);