X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Ftracefile.c;h=8ac4b5061de96a70269dfedc3a539642d55c11cd;hb=f63ebe5196f36fcf40385d29cfc37288c4d70817;hp=e4325b1df0609914d56ff103b93f8ba874abe53f;hpb=dd3a6d3981f13150b4262a418f5ee00c715eda71;p=lttv.git diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index e4325b1d..8ac4b506 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -1356,22 +1356,24 @@ LttTrace *ltt_trace_open(const gchar *pathname) 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; @@ -2215,7 +2217,13 @@ no_offset: /* 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;