return err;
}
+/*
+ * Open a trace and return its LttTrace handle.
+ *
+ * pathname must be the directory of the trace
+ */
LttTrace *ltt_trace_open(const gchar *pathname)
{
for(i=0; i<group->len; i++) {
tf = &g_array_index (group, LttTracefile, i);
- if(ltt_process_facility_tracefile(tf))
- goto facilities_error;
+ if (tf->cpu_online)
+ if(ltt_process_facility_tracefile(tf))
+ goto facilities_error;
}
return t;
}
-/******************************************************************************
+/* Open another, completely independant, instance of a trace.
+ *
+ * A read on this new instance will read the first event of the trace.
+ *
* When we copy a trace, we want all the opening actions to happen again :
* the trace will be reopened and totally independant from the original.
* That's why we call ltt_trace_open.
- *****************************************************************************/
+ */
LttTrace *ltt_trace_copy(LttTrace *self)
{
return ltt_trace_open(g_quark_to_string(self->pathname));
}
+/*
+ * Close a trace
+ */
+
void ltt_trace_close(LttTrace *t)
{
g_datalist_clear(&t->tracefiles);
return EPERM;
}
+/* Seek to a position indicated by an LttEventPosition
+ */
int ltt_tracefile_seek_position(LttTracefile *tf, const LttEventPosition *ep)
{
err = ltt_tracefile_read_update_event(tf);
if(err) goto fail;
+
+ /* deactivate this, as it does nothing for now
err = ltt_tracefile_read_op(tf);
if(err) goto fail;
+ */
return 0;
return 1;
}
+/* Given a TSC value, return the LttTime (seconds,nanoseconds) it
+ * corresponds to.
+ */
+
LttTime ltt_interpolate_time_from_tsc(LttTracefile *tf, guint64 tsc)
{
LttTime time;
if(err) return err;
err = ltt_tracefile_read_update_event(tf);
if(err) return err;
+
+ /* deactivate this, as it does nothing for now
err = ltt_tracefile_read_op(tf);
if(err) return err;
+ */
return 0;
}
return 0;
}
+/* do an operation when reading a new event */
-/* do specific operation on events */
+/* This function does nothing for now */
+#if 0
int ltt_tracefile_read_op(LttTracefile *tf)
{
LttEvent *event;
event = &tf->event;
- /* do event specific operation */
+ /* do event specific operation */
+
+ /* nothing */
- /* do something if its an heartbeat event : increment the heartbeat count */
- //if(event->facility_id == LTT_FACILITY_CORE)
- // if(event->event_id == LTT_EVENT_HEARTBEAT)
- // tf->cur_heart_beat_number++;
-
return 0;
}
+#endif
static void print_debug_event_header(LttEvent *ev, void *start_pos, void *end_pos)
{