create directories branches, tags, trunk
[lttv.git] / ltt / branches / poly / lttv / lttv / batchtest.c
index 9b4184bd9cf1b6b628f2d2fe2d0e13213526d536..bc68f3730307d6480c976d6b6848dbee87128dee 100644 (file)
@@ -35,8 +35,6 @@
 #include <lttv/stats.h>
 #include <ltt/trace.h>
 #include <ltt/event.h>
-#include <ltt/type.h>
-#include <ltt/facility.h>
 
 #define __UNUSED__ __attribute__((__unused__))
 
@@ -173,7 +171,8 @@ gboolean trace_event(void __UNUSED__ *hook_data, void *call_data)
   ltt_event_position(e, a_event_position);
   ltt_event_position_get(a_event_position, &tf, &nb_block, &offset, &tsc);
   fprintf(stderr,"Event %s %lu.%09lu [%u 0x%x tsc %llu]\n",
-      g_quark_to_string(ltt_eventtype_name(ltt_event_eventtype(e))),
+      g_quark_to_string(marker_get_info_from_id(ltt_tracefile_get_trace(tf),
+                       ltt_event_id(e))->name),
       tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec,
       nb_block, offset, tsc);
   return FALSE;
@@ -229,8 +228,10 @@ gboolean save_state_copy_event(void *hook_data, void *call_data)
 
   FILE *fp;
 
+  LttTrace *trace = ((LttvTracefileContext *)tfs)->t_context->t;
+
   if(ts->nb_event == 0 && 
-      ltt_eventtype_name(ltt_event_eventtype(e)) 
+      marker_get_info_from_id(trace, e->event_id)->name
                             == QUARK_BLOCK_START) {
     if(a_save_sample != NULL) {
       filename = g_string_new("");
@@ -298,15 +299,15 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data)
   FILE *fp;
   LttTime time, previous_time;
   LttEvent *event = ltt_tracefile_get_event(tracefile);
-  LttFacility *facility;
-  LttEventType *event_type;
+  //LttEventType *event_type;
+  struct marker_info *minfo;
   int err;
   gchar mod_name[PATH_MAX];
 
   /* start_count is always initialized in this function _if_ there is always
    * a block_start before a block_end.
    */
-  long long unsigned cycle_count, start_count=0, delta_cycle;
+  //long long unsigned cycle_count, start_count=0, delta_cycle;
 
 
   filename = g_string_new("");
@@ -328,15 +329,15 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data)
 
   do {
     LttTracefile *tf_pos;
-    facility = ltt_event_facility(event);
-    event_type = ltt_event_eventtype(event);
+    //event_type = ltt_event_eventtype(event);
+    minfo = marker_get_info_from_id(ltt_tracefile_get_trace(tracefile),
+                                       ltt_event_id(event));
     time = ltt_event_time(event);
     ltt_event_position(event, a_event_position);
     ltt_event_position_get(a_event_position, &tf_pos, &nb_block, &offset, &tsc);
     //fprintf(fp,"%s.%s: %llu %lu.%09lu position %u/%u\n", 
-    fprintf(fp, "%s.%s: %llu %lu.%09lu position %u/%u, tracefile %s\n", 
-        g_quark_to_string(ltt_facility_name(facility)),
-        g_quark_to_string(ltt_eventtype_name(event_type)),
+    fprintf(fp, "%s: %llu %lu.%09lu position %u/%u, tracefile %s\n", 
+       g_quark_to_string(minfo->name),
         tsc, (unsigned long)time.tv_sec, 
         (unsigned long)time.tv_nsec, 
         nb_block, offset,
@@ -375,7 +376,8 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data)
     }
     else {
 #endif //0
-      if(ltt_time_compare(time, previous_time) == 0) nb_equal++;
+      if(ltt_time_compare(time, previous_time) == 0)
+       nb_equal++;
       else if(nb_equal > 0) {
         g_warning("Consecutive %d events with time %lu.%09lu",
                    nb_equal + 1, previous_time.tv_sec, previous_time.tv_nsec);
@@ -409,14 +411,6 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
 
   LttTrace *trace;
 
-  long long unsigned start_nsec, end_nsec, delta_nsec, added_nsec, added_nsec2;
-
-  double cycle_per_nsec, nsec_per_cycle;
-
-  long long interpolated_nsec, interpolated_nsec2, end_nsec_sec, end_nsec_nsec;
-
-  LttTime start_time;
-
   LttTime max_time = { G_MAXULONG, G_MAXULONG };
 
   a_event_position = ltt_event_position_new();
This page took 0.023987 seconds and 4 git commands to generate.