#define PAGE_MASK (~(page_size-1))
#define PAGE_ALIGN(addr) (((addr)+page_size-1)&PAGE_MASK)
-/* obtain the time of an event */
-
-static inline LttTime getEventTime(LttTracefile * tf);
-
-
/* set the offset of the fields belonging to the event,
need the information of the archecture */
void set_fields_offsets(LttTracefile *tf, LttEventType *event_type);
{
guint raw_name_len = strlen(raw_name);
gchar char_name[PATH_MAX];
- gchar *digit_begin;
int i;
int underscore_pos;
long int cpu_num;
GQuark name;
guint num;
GArray *group;
- LttTracefile *tf;
- guint len;
if(get_tracefile_name_number(rel_path, &name, &num))
continue; /* invalid name */
return 0;
/* Error handling */
-facility_error:
event_id_error:
fac_id_error:
update_error:
/* Open all the tracefiles */
g_datalist_init(&t->tracefiles);
- if(open_tracefiles(t, abs_path, ""))
+ if(open_tracefiles(t, abs_path, "")) {
+ g_warning("Error opening tracefile %s", abs_path);
goto open_error;
+ }
/* Prepare the facilities containers : array and mapping */
/* Array is zeroed : the "exists" field is set to false by default */
static void ltt_tracefile_time_span_get(LttTracefile *tf,
LttTime *start, LttTime *end)
{
- struct ltt_block_start_header * header;
int err;
err = map_block(tf, 0);
else if(ret) goto fail;
if(ltt_time_compare(time, tf->event.event_time) >= 0)
- break;
+ goto found;
}
} else if(ltt_time_compare(time, tf->buffer.begin.timestamp) < 0) {
err = ltt_tracefile_read_op(tf);
if(err) goto fail;
- return;
+ return 0;
fail:
g_error("ltt_tracefile_seek_time failed on tracefile %s",
g_quark_to_string(tf->name));
+ return 1;
}
/* Calculate the real event time based on the buffer boundaries */
/* do specific operation on events */
int ltt_tracefile_read_op(LttTracefile *tf)
{
- int err;
- LttFacility *f;
- void * pos;
LttEvent *event;
event = &tf->event;
* event specific operation. */
int ltt_tracefile_read_update_event(LttTracefile *tf)
{
- int err;
- LttFacility *f;
void * pos;
LttEvent *event;
tf->buffer.begin.timestamp = ltt_get_time(LTT_GET_BO(tf),
&header->begin.timestamp);
tf->buffer.begin.timestamp.tv_nsec *= NSEC_PER_USEC;
- g_warning("block %u begin : %lu.%lu", block_num,
+ g_debug("block %u begin : %lu.%lu", block_num,
tf->buffer.begin.timestamp.tv_sec, tf->buffer.begin.timestamp.tv_nsec);
tf->buffer.begin.cycle_count = ltt_get_uint64(LTT_GET_BO(tf),
&header->begin.cycle_count);
tf->buffer.end.timestamp = ltt_get_time(LTT_GET_BO(tf),
&header->end.timestamp);
tf->buffer.end.timestamp.tv_nsec *= NSEC_PER_USEC;
- g_warning("block %u end : %lu.%lu", block_num,
+ g_debug("block %u end : %lu.%lu", block_num,
tf->buffer.end.timestamp.tv_sec, tf->buffer.end.timestamp.tv_nsec);
tf->buffer.end.cycle_count = ltt_get_uint64(LTT_GET_BO(tf),
&header->end.cycle_count);
g_quark_to_string(tf->name));
goto event_type_error;
}
-
+
if(event_type->root_field)
size = get_field_type_size(tf, event_type,
0, 0, event_type->root_field, tf->event.data);
/* Check consistency between kernel and LTTV structure sizes */
g_assert(tf->event.data_size == tf->event.event_size);
-
+
return;
facility_error:
{
int ret = 0;
void *pos;
- ssize_t event_size;
/* seek over the buffer header if we are at the buffer start */
if(tf->event.offset == 0) {
LttField *field1, LttField *field2)
{
guint different = 0;
- enum field_status local_fixed_root, local_fixed_parent;
guint i;
LttType *type1;
LttType *type2;
type1 = field1->field_type;
type2 = field2->field_type;
- size_t current_root_offset;
- size_t current_offset;
- enum field_status current_child_status, final_child_status;
- size_t max_size;
-
if(type1->type_class != type2->type_class) {
different = 1;
goto end;