* Parameters:
*
* @buf : the buffer to commit to.
- * @reserved : address of the beginnig of the reserved slot.
+ * @reserved : address of the end of the event header.
* @slot_size : size of the reserved slot.
*
*/
void *reserved,
unsigned int slot_size)
{
- unsigned int offset_begin = reserved - ltt_buf->start;
+ unsigned int offset_end = reserved - ltt_buf->start;
int commit_count;
commit_count = atomic_add_return(slot_size,
- <t_buf->commit_count[SUBBUF_INDEX(offset_begin,
+ <t_buf->commit_count[SUBBUF_INDEX(offset_end-1,
ltt_buf)]);
/* Check if all commits have been done */
if(commit_count ==
- atomic_read(<t_buf->reserve_count[SUBBUF_INDEX(offset_begin, ltt_buf)])) {
- ltt_deliver_callback(ltt_buf, SUBBUF_INDEX(offset_begin, ltt_buf), NULL);
+ atomic_read(<t_buf->reserve_count[SUBBUF_INDEX(offset_end-1, ltt_buf)])) {
+ ltt_deliver_callback(ltt_buf, SUBBUF_INDEX(offset_end-1, ltt_buf), NULL);
}
}