float word order
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 23 Aug 2005 20:46:55 +0000 (20:46 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 23 Aug 2005 20:46:55 +0000 (20:46 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1065 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/ltt-private.h
ltt/branches/poly/ltt/tracefile.c
ltt/branches/poly/lttv/lttv/tracecontext.c
ltt/branches/poly/lttv/lttv/tracecontext.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/init_module.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.h

index 25f2d82443f3b5c94e1977b2ceee9df7fd8bafa2..bcd745ca5d917a1f8e29eaf8b953b467c1ec09b6 100644 (file)
@@ -141,6 +141,7 @@ struct ltt_trace_header {
   uint32_t        magic_number;
   uint32_t        arch_type;
   uint32_t        arch_variant;
+  uint32_t        float_word_order;
   uint8_t         arch_size;
   //uint32_t        system_type;
   uint8_t          major_version;
index 9da89781e2f4aa1de9f340ca4df8aadc442e507c..20ba35dec91d9ccb1a628485299824d129e08212 100644 (file)
@@ -248,6 +248,9 @@ gint ltt_tracefile_open(LttTrace *t, gchar * fileName, LttTracefile *tf)
     tf->reverse_bo = 1;
   else  /* invalid magic number, bad tracefile ! */
     goto unmap_file;
+  /* Get float byte order : might be different from int byte order
+   * (or is set to 0 if the trace has no float (kernel trace)) */
+  tf->float_word_order = header->trace.float_word_order;
     
   //store the size of the file
   tf->file_size = lTDFStat.st_size;
index 98d91a69fe859dec9ade5b480d38e0f8b3734671..5c2a17cb33b1ac349a1a609fe88d7098104b5494 100644 (file)
@@ -178,7 +178,7 @@ init(LttvTracesetContext *self, LttvTraceset *ts)
   self->traces = g_new(LttvTraceContext *, nb_trace);
   self->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
   self->ts_a = lttv_traceset_attribute(ts);
-  self->sync_position = lttv_traceset_context_position_new();
// self->sync_position = lttv_traceset_context_position_new();
   for(i = 0 ; i < nb_trace ; i++) {
     tc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self);
     self->traces[i] = tc;
@@ -250,7 +250,7 @@ void fini(LttvTracesetContext *self)
 
   g_tree_destroy(self->pqueue);
   g_object_unref(self->a);
-  lttv_traceset_context_position_destroy(self->sync_position);
// lttv_traceset_context_position_destroy(self->sync_position);
 
   nb_trace = lttv_traceset_number(ts);
 
@@ -1184,7 +1184,7 @@ LttvTracefileContext *lttv_traceset_context_get_current_tfc(LttvTracesetContext
 
   return tfc;
 }
-
+#if 0
 /* lttv_process_traceset_synchronize_tracefiles
  *
  * Use the sync_position field of the trace set context to synchronize each
@@ -1205,5 +1205,5 @@ void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc)
   lttv_traceset_context_position_save(tsc, tsc->sync_position);
 }
 
-
+#endif //0
 
index 429a90162f5545343d884e2991a850d0f504f80c..4be8be70aba6388e7544656c3e2ab8c7bdc31d41 100644 (file)
@@ -94,8 +94,8 @@ struct _LttvTracesetContext {
   TimeInterval time_span;
   GTree *pqueue;
 
-  LttvTracesetContextPosition *sync_position;   /* position at which to sync the
-                                                   trace context */
// LttvTracesetContextPosition *sync_position;   /* position at which to sync the
//                                                  trace context */
 };
 
 struct _LttvTracesetContextClass {
@@ -331,8 +331,8 @@ gint compare_tracefile(gconstpointer a, gconstpointer b);
 
 /* Synchronisation helpers : save/restore synchronization between ltt traces and
  * a traceset context. */
-void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *tsc);
+//void lttv_process_traceset_synchronize_tracefiles(LttvTracesetContext *tsc);
 
-void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc);
+//void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc);
 
 #endif // PROCESSTRACE_H
index 42489de76c90403662a9a4bad97932adedb7c078..c9f55de6a6e90a9b1195ad4bde846ebb810d8282 100644 (file)
@@ -57,6 +57,7 @@ LttvTraceInfo LTTV_TRACES,
        LTTV_NOTIFY_CURRENT,
        LTTV_COMPUTATION_TRACESET,
        LTTV_COMPUTATION_TRACESET_CONTEXT,
+       LTTV_COMPUTATION_SYNC_POSITION,
        LTTV_BEFORE_CHUNK_TRACESET,
        LTTV_BEFORE_CHUNK_TRACE,
        LTTV_BEFORE_CHUNK_TRACEFILE,
@@ -153,6 +154,8 @@ static void init() {
   LTTV_COMPUTATION_TRACESET = g_quark_from_string("computation_traceset");
   LTTV_COMPUTATION_TRACESET_CONTEXT =
                         g_quark_from_string("computation_traceset_context");
+  LTTV_COMPUTATION_SYNC_POSITION =
+                        g_quark_from_string("computation_sync_position");
   LTTV_BEFORE_CHUNK_TRACESET = g_quark_from_string("before_chunk_traceset");
   LTTV_BEFORE_CHUNK_TRACE = g_quark_from_string("before_chunk_trace");
   LTTV_BEFORE_CHUNK_TRACEFILE = g_quark_from_string("before_chunk_tracefile");
index a37d1e398b2506b9c9943fcd90fb632139fcec5e..56bf076d8740857d377d042b0f7457c32147903d 100644 (file)
@@ -161,6 +161,7 @@ void lttvwindowtraces_add_trace(LttvTrace *trace)
   /* create new traceset and tracesetcontext */
   LttvTraceset *ts;
   LttvTracesetStats *tss;
+  LttvTracesetContextPosition *sync_position;
   
   attribute = lttv_trace_attribute(trace);
   g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
@@ -181,6 +182,14 @@ void lttvwindowtraces_add_trace(LttvTrace *trace)
   
   lttv_context_init(LTTV_TRACESET_CONTEXT(tss), ts);
 
+  g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
+                                LTTV_COMPUTATION_SYNC_POSITION,
+                                LTTV_POINTER,
+                                &value));
+
+  sync_position = lttv_traceset_context_position_new();
+  *(value.v_pointer) = sync_position;
+
   value = lttv_attribute_add(attribute,
                      LTTV_REQUESTS_QUEUE,
                      LTTV_POINTER);
@@ -227,6 +236,7 @@ void lttvwindowtraces_remove_trace(LttvTrace *trace)
       /* destroy traceset and tracesetcontext */
       LttvTraceset *ts;
       LttvTracesetStats *tss;
+      LttvTracesetContextPosition *sync_position;
       
       l_attribute = lttv_trace_attribute(trace);
 
@@ -249,6 +259,17 @@ void lttvwindowtraces_remove_trace(LttvTrace *trace)
                                     &value));
       ts = (LttvTraceset*)*(value.v_pointer);
      
+      g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(l_attribute),
+                                    LTTV_COMPUTATION_SYNC_POSITION,
+                                    LTTV_POINTER,
+                                    &value));
+      sync_position = (LttvTracesetContextPosition*)*(value.v_pointer);
+
+      lttv_traceset_context_position_destroy(sync_position);
+      
+      lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute),
+                                     LTTV_COMPUTATION_SYNC_POSITION);
+
       g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(l_attribute),
                                     LTTV_COMPUTATION_TRACESET_CONTEXT,
                                     LTTV_POINTER,
@@ -827,6 +848,7 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
   LttvTracesetContext *tsc;
   LttvTracesetStats *tss;
   LttvTraceset *ts;
+  LttvTracesetContextPosition *sync_position;
   LttvAttribute *attribute;
   LttvAttribute *g_attribute = lttv_global_attributes();
   GSList **list_out, **list_in, **notify_in, **notify_out;
@@ -877,6 +899,12 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
   tss = (LttvTracesetStats*)*(value.v_pointer);
   g_assert(LTTV_IS_TRACESET_CONTEXT(tsc));
   g_assert(LTTV_IS_TRACESET_STATS(tss));
+  
+  type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute),
+                                     LTTV_COMPUTATION_SYNC_POSITION,
+                                     &value);
+  g_assert(type == LTTV_POINTER);
+  sync_position = (LttvTracesetContextPosition*)*(value.v_pointer);
  
   /* There is no events requests pending : we should never have been called! */
   g_assert(g_slist_length(*list_out) != 0 || g_slist_length(*list_in) != 0);
@@ -895,7 +923,8 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
     }
   }
   /* 0.2 Sync tracefiles */
-  lttv_process_traceset_synchronize_tracefiles(tsc);
+  g_assert(lttv_process_traceset_seek_position(tsc, sync_position) == 0);
+ // lttv_process_traceset_synchronize_tracefiles(tsc);
   /* 1. Before processing */
   {
     /* if list_in is empty */
@@ -1214,7 +1243,8 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
   }
   /* 4. Unlock traces */
   {
-    lttv_process_traceset_get_sync_data(tsc);
+ //   lttv_process_traceset_get_sync_data(tsc);
+    lttv_traceset_context_position_save(tsc, sync_position);
     guint iter_trace;
     
     for(iter_trace=0; 
index fffb3025cf29558b0299a32efdd700ac781679c8..8de3ba357694bedbe8db68dd5b6c4028494b14b7 100644 (file)
@@ -81,6 +81,7 @@ extern LttvTraceInfo LTTV_TRACES,
               LTTV_NOTIFY_CURRENT,
               LTTV_COMPUTATION_TRACESET,
               LTTV_COMPUTATION_TRACESET_CONTEXT,
+              LTTV_COMPUTATION_SYNC_POSITION,
               LTTV_BEFORE_CHUNK_TRACESET,
               LTTV_BEFORE_CHUNK_TRACE,
               LTTV_BEFORE_CHUNK_TRACEFILE,
This page took 0.029244 seconds and 4 git commands to generate.