create directories branches, tags, trunk
[lttv.git] / ltt / branches / poly / ltt / tracefile.c
index 31100215d80f9340cefee0bd52a664435d23ba1e..995a907506b4a937efffe2f8a18a792c8de0d982 100644 (file)
@@ -949,6 +949,11 @@ seek_error:
   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)
 {
@@ -1026,8 +1031,9 @@ 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;
@@ -1044,16 +1050,23 @@ alloc_error:
 
 }
 
-/******************************************************************************
+/* 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);
@@ -1251,6 +1264,8 @@ fail:
   return EPERM;
 }
 
+/* Seek to a position indicated by an LttEventPosition
+ */
 
 int ltt_tracefile_seek_position(LttTracefile *tf, const LttEventPosition *ep)
 {
@@ -1274,8 +1289,11 @@ 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;
 
@@ -1285,6 +1303,10 @@ fail:
   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;
@@ -1350,8 +1372,11 @@ int ltt_tracefile_read(LttTracefile *tf)
   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;
 }
@@ -1385,23 +1410,23 @@ int ltt_tracefile_read_seek(LttTracefile *tf)
   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)
 {
This page took 0.024095 seconds and 4 git commands to generate.