* (or is set to 0 if the trace has no float (kernel trace)) */
tf->float_word_order = any->float_word_order;
tf->has_alignment = any->has_alignment;
+ tf->has_heartbeat = any->has_heartbeat;
if(t) {
t->arch_type = ltt_get_uint32(LTT_GET_BO(tf),
t->ltt_major_version = any->major_version;
t->ltt_minor_version = any->minor_version;
t->flight_recorder = any->flight_recorder;
- t->has_heartbeat = any->has_heartbeat;
t->compact_facilities = NULL;
}
if(!t->compact_facilities)
t->compact_facilities = ltt_trace_facility_get_by_name(t,
g_quark_from_string("flight-compact"));
- /* FIXME : currently does not support unload/load of compact
- * facility during tracing. Should check for the currently loaded
- * version of the facility. */
- g_assert(t->compact_facilities);
- g_assert(t->compact_facilities->len == 1);
- {
- guint facility_id = g_array_index(t->compact_facilities, guint, 0);
- LttFacility *fac = ltt_trace_facility_by_id(t, facility_id);
- unsigned int num = ltt_facility_eventtype_number(fac);
- /* Could be done much quicker, but not on much used code path */
- if(num) {
- t->compact_event_bits = 1;
- while(num >>= 1)
- t->compact_event_bits++;
- } else
- t->compact_event_bits = 0;
+ if (t->compact_facilities) {
+ /* FIXME : currently does not support unload/load of compact
+ * facility during tracing. Should check for the currently loaded
+ * version of the facility. */
+ g_assert(t->compact_facilities->len == 1);
+ g_assert(t->compact_facilities);
+ {
+ guint facility_id = g_array_index(t->compact_facilities, guint, 0);
+ LttFacility *fac = ltt_trace_facility_by_id(t, facility_id);
+ unsigned int num = ltt_facility_eventtype_number(fac);
+ /* Could be done much quicker, but not on much used code path */
+ if(num) {
+ t->compact_event_bits = 1;
+ while(num >>= 1)
+ t->compact_event_bits++;
+ } else
+ t->compact_event_bits = 0;
+ }
}
return t;
if(!tf->compact)
pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
else {
- g_assert(tf->trace->has_heartbeat);
+ g_assert(tf->has_heartbeat);
pos += ltt_align((size_t)pos, sizeof(uint32_t), tf->has_alignment);
}
- if(tf->trace->has_heartbeat) {
+ if(tf->has_heartbeat) {
event->timestamp = ltt_get_uint32(LTT_GET_BO(tf),
pos);
if(!tf->compact) {
/* Event size too big to fit in the event size field */
tf->event.event_size = tf->event.data_size;
}
- g_assert(tf->event.data_size == tf->event.event_size);
+ if (tf->event.data_size != tf->event.event_size) {
+ g_error("Kernel/LTTV event size differs for event %s.%s: kernel %u, LTTV %u",
+ g_quark_to_string(f->name), g_quark_to_string(event_type->name),
+ tf->event.event_size, tf->event.data_size);
+ exit(-1);
+ }
+ //g_assert(tf->event.data_size == tf->event.event_size);
return;