break;
case 2:
switch(header->minor_version) {
- case 1:
+ case 2:
{
- struct ltt_subbuffer_header_2_1 *vheader = header;
+ struct ltt_subbuffer_header_2_2 *vheader = header;
tf->buffer_header_size = ltt_subbuffer_header_size();
tf->tscbits = 27;
tf->eventbits = 5;
tf->file_size = lTDFStat.st_size;
tf->buf_size = ltt_get_uint32(LTT_GET_BO(tf), &header->buf_size);
tf->num_blocks = tf->file_size / tf->buf_size;
+ tf->events_lost = 0;
+ tf->subbuf_corrupt = 0;
if(munmap(tf->buffer.head,
PAGE_ALIGN(ltt_subbuffer_header_size()))) {
goto metadata_error;
}
- /* Get the trace information for the control/metadata_0 tracefile */
+ /*
+ * Get the trace information for the control/metadata_0 tracefile.
+ * Getting a correct trace start_time and start_tsc is insured by the fact
+ * that no subbuffers are supposed to be lost in the metadata channel.
+ * Therefore, the first subbuffer contains the start_tsc timestamp in its
+ * buffer header.
+ */
g_assert(group->len > 0);
tf = &g_array_index (group, LttTracefile, 0);
header = (ltt_subbuffer_header_t *)tf->buffer.head;
- g_assert(parse_trace_header(header, tf, t) == 0);
+ ret = parse_trace_header(header, tf, t);
+ g_assert(!ret);
t->num_cpu = group->len;
tf->event.block = block_num;
tf->event.offset = 0;
+ if (header->events_lost) {
+ g_warning("%d events lost so far in tracefile %s at block %u",
+ tf->events_lost - header->events_lost,
+ g_quark_to_string(tf->long_name),
+ block_num);
+ tf->events_lost = header->events_lost;
+ }
+ if (header->subbuf_corrupt) {
+ g_warning("%d subbuffer(s) corrupted so far in tracefile %s at block %u",
+ tf->subbuf_corrupt - header->subbuf_corrupt,
+ g_quark_to_string(tf->long_name),
+ block_num);
+ tf->subbuf_corrupt = header->subbuf_corrupt;
+ }
+
return 0;
map_error: