Fix variable sized sb, update version
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 17 Nov 2009 21:35:57 +0000 (16:35 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 17 Nov 2009 21:35:57 +0000 (16:35 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
configure.ac
ltt/tracefile.c

index 2869ea9ffb7f895cf0826958878eea643be359ff..9fdb20dc7c569e49a13a8a6acf559cc0dc1fecb5 100644 (file)
@@ -21,7 +21,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT([lttv], [0.12.21-16112009], [ltt-dev@lists.casi.polymtl.ca])
+AC_INIT([lttv], [0.12.22-17112009], [ltt-dev@lists.casi.polymtl.ca])
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(config.h)
 AM_PROG_LIBTOOL
index cb8cf93982a92dd7ca41fc026b9501d35ad555ae..d61f4af879f2425ef243abc63549dbdbd6e5b848 100644 (file)
@@ -240,7 +240,7 @@ int ltt_trace_create_block_index(LttTracefile *tf)
 
     /* map block header */
     header = mmap(0, header_map_size, PROT_READ, 
-                  MAP_PRIVATE, tf->fd, 0);
+                  MAP_PRIVATE, tf->fd, (off_t)offset);
     if(header == MAP_FAILED) {
       perror("Error in allocating memory for buffer of tracefile");
       return -1;
@@ -1441,6 +1441,9 @@ static gint map_block(LttTracefile * tf, guint block_num)
   ret = get_block_offset_size(tf, block_num, &offset, &size);
   g_assert(!ret);
 
+  g_debug("Map block %u, offset %llu, size %u\n", block_num,
+          (unsigned long long)offset, (unsigned int)size);
+
   /* Multiple of pages aligned head */
   tf->buffer.head = mmap(0, (size_t)size, PROT_READ, MAP_PRIVATE,
                          tf->fd, (off_t)offset);
@@ -1463,13 +1466,13 @@ static gint map_block(LttTracefile * tf, guint block_num)
   tf->buffer.offset = offset;
   tf->buffer.size = ltt_get_uint32(LTT_GET_BO(tf),
                                    &header->sb_size);
-  g_assert(size == tf->buffer.size);
   tf->buffer.data_size = ltt_get_uint32(LTT_GET_BO(tf),
                                         &header->data_size);
   tf->buffer.tsc =  tf->buffer.begin.cycle_count;
   tf->event.tsc = tf->buffer.tsc;
   tf->buffer.freq = tf->buffer.begin.freq;
 
+  g_assert(size == tf->buffer.size);
   g_assert(tf->buffer.data_size <= tf->buffer.size);
 
   if (tf->trace->start_freq)
This page took 0.025309 seconds and 4 git commands to generate.