From 9355666580b6f4f8fc006e8a89f46833e3cf30ee Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 17 Nov 2009 16:35:57 -0500 Subject: [PATCH] Fix variable sized sb, update version Signed-off-by: Mathieu Desnoyers --- configure.ac | 2 +- ltt/tracefile.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 2869ea9f..9fdb20dc 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ltt/tracefile.c b/ltt/tracefile.c index cb8cf939..d61f4af8 100644 --- a/ltt/tracefile.c +++ b/ltt/tracefile.c @@ -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) -- 2.34.1