Update FSF address
[lttv.git] / lttv / lttv / batchtest.c
index 08b892beb43d1894c02d7d333bae403fe052ad9f..6b2dc95a50049828fa0a37d56eb5fc7223d9e832 100644 (file)
@@ -12,8 +12,8 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
- * MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA 02110-1301, USA.
  */
 
 /* This module inserts a hook in the program main loop. This hook processes 
 #include <lttv/hook.h>
 #include <lttv/option.h>
 #include <lttv/module.h>
-#include <lttv/tracecontext.h>
 #include <lttv/state.h>
-#include <lttv/stats.h>
-#include <ltt/trace.h>
-#include <ltt/event.h>
+#include <lttv/traceset.h>
+#include <lttv/traceset-process.h>
 
 #define __UNUSED__ __attribute__((__unused__))
 
@@ -98,6 +96,7 @@ typedef struct _save_state {
 
 static void lttv_trace_option(void __UNUSED__ *hook_data)
 { 
+#ifdef BABEL_CLEANUP
        LttTrace *trace;
 
        trace = ltt_trace_open(a_trace);
@@ -106,6 +105,11 @@ static void lttv_trace_option(void __UNUSED__ *hook_data)
        } else {
                lttv_traceset_add(traceset, lttv_trace_new(trace));
        }
+#endif
+
+       if(lttv_traceset_add_path(traceset, a_trace) < 0) {
+                       g_critical("cannot open trace %s", a_trace);
+       }
 }
 
 static double get_time() 
@@ -390,6 +394,7 @@ close:
        fclose(fp);
 }
 
+// TODO mdenis: adapt to babeltrace
 static gboolean process_traceset(void __UNUSED__ *hook_data, 
                                void __UNUSED__ *call_data)
 {
@@ -408,10 +413,11 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
        //guint i, j, count, nb_control, nb_tracefile, nb_block, nb_event, nb_equal;
        guint i, j, count;
 
-       LttTrace *trace;
-
        LttTime max_time = { G_MAXULONG, G_MAXULONG };
 
+#ifdef BABEL_CLEANUP
+       LttTrace *trace;
+
        a_event_position = ltt_event_position_new();
 
        GData **tracefiles_groups;
@@ -431,6 +437,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
 
                }
        }
+#endif
 
        tscs = g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
        ts = &tscs->parent;
@@ -998,8 +1005,10 @@ static void destroy()
        for(i = 0 ; i < nb ; i++) {
                trace = lttv_traceset_get(traceset, i);
                lttv_traceset_remove(traceset,i);
+#ifdef BABEL_CLEANUP
                ltt_trace_close(lttv_trace(trace));
                lttv_trace_destroy(trace);
+#endif
        }
 
        lttv_traceset_destroy(traceset);
This page took 0.022895 seconds and 4 git commands to generate.