fix multiversion traces handling
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Aug 2005 04:12:43 +0000 (04:12 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Aug 2005 04:12:43 +0000 (04:12 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1070 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/ltt-private.h
ltt/branches/poly/ltt/tracefile.c

index b525f9d70edb7478707e3d477ed956bcbe6e338a..bf659e02e19f30c7aea236851f98ceb11f6e0ce8 100644 (file)
@@ -183,7 +183,7 @@ struct ltt_block_start_header {
   } end;
   uint32_t                lost_size;  /* Size unused at the end of the buffer */
   uint32_t                buf_size;   /* The size of this sub-buffer */
-  char                    trace[0];
+  struct ltt_trace_header_any trace[0];
 } LTT_PACKED_STRUCT;
 
 
index 82445c718c98d06ba02cd2fac75a3a4ebae210c7..24fe6fe5f5e7d8760e661a1531fa7db1f50e3015 100644 (file)
@@ -310,7 +310,10 @@ gint ltt_tracefile_open(LttTrace *t, gchar * fileName, LttTracefile *tf)
   
   header = (struct ltt_block_start_header*)tf->buffer.head;
   
-  if(parse_trace_header(header->trace, tf, NULL)) goto unmap_file;
+  if(parse_trace_header(header->trace, tf, NULL)) {
+    g_warning("parse_trace_header error");
+    goto unmap_file;
+  }
     
   //store the size of the file
   tf->file_size = lTDFStat.st_size;
@@ -1112,7 +1115,8 @@ LttTrace *ltt_trace_open(const gchar *pathname)
   g_assert(group->len > 0);
   tf = &g_array_index (group, LttTracefile, 0);
   header = (struct ltt_block_start_header*)tf->buffer.head;
-  g_assert(parse_trace_header(header->trace, tf, t) == 0);
+  g_assert(parse_trace_header(header->trace,
+                                  tf, t) == 0);
 
   t->num_cpu = group->len;
   
@@ -1858,8 +1862,7 @@ static int ltt_seek_next_event(LttTracefile *tf)
   
   /* seek over the buffer header if we are at the buffer start */
   if(tf->event.offset == 0) {
-    tf->event.offset += sizeof(struct ltt_block_start_header)
-        + tf->buffer_header_size;
+    tf->event.offset += tf->buffer_header_size;
 
     if(tf->event.offset == tf->buf_size - tf->buffer.lost_size) {
       ret = ERANGE;
This page took 0.027098 seconds and 4 git commands to generate.