X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libust%2Fbuffers.c;h=849cad7ad9326031cf7a42ef0a086f60d8b3300b;hb=ce3296b66be6225497ebd363457f4ccd5f3a2f7a;hp=c644cfb72ad2ddc50e6fa324d3a17082cf8ed61b;hpb=e17571a59eef2b054c7432f6cba10c2cb467a182;p=ust.git diff --git a/libust/buffers.c b/libust/buffers.c index c644cfb..849cad7 100644 --- a/libust/buffers.c +++ b/libust/buffers.c @@ -307,8 +307,9 @@ static void ltt_buffer_begin(struct ust_buffer *buf, subbuf_idx * buf->chan->subbuf_size); header->cycle_count_begin = tsc; - header->lost_size = 0xFFFFFFFF; /* for debugging */ - header->buf_size = buf->chan->subbuf_size; + header->data_size = 0xFFFFFFFF; /* for recognizing crashed buffers */ + header->sb_size = 0xFFFFFFFF; /* for recognizing crashed buffers */ + /* FIXME: add memory barrier? */ ltt_write_trace_header(channel->trace, header); } @@ -323,9 +324,10 @@ static notrace void ltt_buffer_end(struct ust_buffer *buf, (struct ltt_subbuffer_header *) ust_buffers_offset_address(buf, subbuf_idx * buf->chan->subbuf_size); + u32 data_size = SUBBUF_OFFSET(offset - 1, buf->chan) + 1; - header->lost_size = SUBBUF_OFFSET((buf->chan->subbuf_size - offset), - buf->chan); + header->data_size = data_size; + header->sb_size = PAGE_ALIGN(data_size); header->cycle_count_end = tsc; header->events_lost = local_read(&buf->events_lost); header->subbuf_corrupt = local_read(&buf->corrupted_subbuffers); @@ -1357,7 +1359,7 @@ static void ltt_reserve_switch_old_subbuf( &buf->commit_count[oldidx].cc); commit_count = local_read(&buf->commit_count[oldidx].cc); ltt_check_deliver(chan, buf, offsets->old - 1, commit_count, oldidx); - ltt_write_commit_counter(buf, oldidx, + ltt_write_commit_counter(chan, buf, oldidx, offsets->old, commit_count, padding_size); } @@ -1388,7 +1390,7 @@ static void ltt_reserve_switch_new_subbuf( commit_count = local_read(&buf->commit_count[beginidx].cc); /* Check if the written buffer has to be delivered */ ltt_check_deliver(chan, buf, offsets->begin, commit_count, beginidx); - ltt_write_commit_counter(buf, beginidx, + ltt_write_commit_counter(chan, buf, beginidx, offsets->begin, commit_count, ltt_subbuffer_header_size()); } @@ -1434,7 +1436,7 @@ static void ltt_reserve_end_switch_current( commit_count = local_read(&buf->commit_count[endidx].cc); ltt_check_deliver(chan, buf, offsets->end - 1, commit_count, endidx); - ltt_write_commit_counter(buf, endidx, + ltt_write_commit_counter(chan, buf, endidx, offsets->end, commit_count, padding_size); } @@ -1519,6 +1521,7 @@ void ltt_force_switch_lockless_slow(struct ust_buffer *buf, offsets.size = 0; + DBG("Switching (forced) %s_%d", chan->channel_name, buf->cpu); /* * Perform retryable operations. */ @@ -1736,6 +1739,7 @@ int ltt_reserve_slot_lockless_slow(struct ust_trace *trace, if (unlikely(offsets.end_switch_old)) { //ust// ltt_clear_noref_flag(chan, buf, SUBBUF_INDEX(offsets.old - 1, chan)); ltt_reserve_switch_old_subbuf(chan, buf, &offsets, tsc); + DBG("Switching %s_%d", chan->channel_name, cpu); } /*