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 debugging */
ltt_write_trace_header(channel->trace, header);
}
(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);
/*
* for flight recording. must be called after relay_commit.
- * This function decrements de subbuffer's lost_size each time the commit count
- * reaches back the reserve offset (module subbuffer size). It is useful for
- * crash dump.
+ * This function increments the subbuffers's commit_seq counter each time the
+ * commit count reaches back the reserve offset (module subbuffer size). It is
+ * useful for crash dump.
*/
#ifdef CONFIG_LTT_VMCORE
static __inline__ void ltt_write_commit_counter(struct rchan_buf *buf,
ltt_check_deliver(chan, buf, offset_end - 1, commit_count, endidx);
/*
- * Update lost_size for each commit. It's needed only for extracting
+ * Update data_size for each commit. It's needed only for extracting
* ltt buffers from vmcore, after crash.
*/
ltt_write_commit_counter(buf, endidx, buf_offset, commit_count, data_size);
largest_align = 1; /* must be non-zero for ltt_align */
data_size = ltt_get_data_size(&closure, serialize_private,
&largest_align, fmt, &args_copy);
- largest_align = min_t(int, largest_align, sizeof(void *));
va_end(args_copy);
/* Iterate on each trace */
#include "tracerconst.h"
#include <ust/marker.h>
#include <ust/probe.h>
+#include "buffers.h"
/* Number of bytes to log with a read/write event */
#define LTT_LOG_RW_SIZE 32L
* used all along the trace.
*/
uint32_t freq_scale; /* Frequency scaling (divisor) */
- uint32_t lost_size; /* Size unused at end of subbuffer */
- uint32_t buf_size; /* Size of this subbuffer */
+ uint32_t data_size; /* Size of data in subbuffer */
+ uint32_t sb_size; /* Subbuffer size (including padding) */
uint32_t events_lost; /*
* Events lost in this subbuffer since
* the beginning of the trace.
* returns : offset where the event data must be written.
*/
static __inline__ size_t ltt_write_event_header(struct ust_trace *trace,
- struct ust_channel *channel,
+ struct ust_channel *chan,
struct ust_buffer *buf, long buf_offset,
u16 eID, u32 event_size,
u64 tsc, unsigned int rflags)
goto slow_path;
header.id_time = eID << LTT_TSC_BITS;
+ header.id_time |= (u32)tsc & LTT_TSC_MASK;
+ ust_buffers_write(buf, buf_offset, &header, sizeof(header));
+ buf_offset += sizeof(header);
return buf_offset;
slow_path:
- return ltt_write_event_header_slow(trace, channel, buf, buf_offset,
+ return ltt_write_event_header_slow(trace, chan, buf, buf_offset,
eID, event_size, tsc, rflags);
}
#define LTT_DEFAULT_N_SUBBUFS_HIGH 2
#define LTT_TRACER_MAGIC_NUMBER 0x00D6B7ED
#define LTT_TRACER_VERSION_MAJOR 2
-#define LTT_TRACER_VERSION_MINOR 4
+#define LTT_TRACER_VERSION_MINOR 5
/**
* ust_write_trace_header - Write trace header
if (((commit_seq - buf->subbuf_size) & commit_seq_mask)
- (USTD_BUFFER_TRUNC(consumed_offset, buf) >> n_subbufs_order)
== 0) {
- /* If it was, we only check the lost_size. This is the lost padding at the end of
- * the subbuffer. */
- valid_length = (unsigned long)buf->subbuf_size - header->lost_size;
+ /* If it was, we only check the data_size. This is the amount of valid data at
+ * the beginning of the subbuffer. */
+ valid_length = header->data_size;
}
else {
- /* If the subbuffer was not fully written, then we don't check lost_size because
+ /* If the subbuffer was not fully written, then we don't check data_size because
* it hasn't been written yet. Instead we check commit_seq and use it to choose
- * a value for lost_size. The viewer will need this value when parsing.
+ * a value for data_size. The viewer will need this value when parsing.
*/
valid_length = commit_seq & (buf->subbuf_size-1);
- header->lost_size = buf->subbuf_size-valid_length;
+ header->data_size = valid_length;
assert(i_subbuf == (last_subbuf % buf->n_subbufs));
}