From: David Goulet Date: Mon, 6 May 2013 15:04:21 +0000 (-0400) Subject: Fix: reset current size for tracefile rotation X-Git-Tag: v2.2.0-rc2~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a6976990852205663a818aed8490d59a135dfc44;p=lttng-tools.git Fix: reset current size for tracefile rotation Fixes #514 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 156fc83ee..71c9f2b49 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1636,6 +1636,8 @@ int relay_process_data(struct relay_command *cmd, struct lttng_ht *streams_ht) goto end; } stream->fd = ret; + /* Reset current size because we just perform a stream rotation. */ + stream->tracefile_size_current = 0; } stream->tracefile_size_current += data_size; do { diff --git a/src/common/consumer.c b/src/common/consumer.c index c4518cc03..01266a700 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1424,6 +1424,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( goto end; } outfd = stream->out_fd = ret; + /* Reset current size because we just perform a rotation. */ + stream->tracefile_size_current = 0; } stream->tracefile_size_current += len; } @@ -1604,6 +1606,8 @@ ssize_t lttng_consumer_on_read_subbuffer_splice( goto end; } outfd = stream->out_fd = ret; + /* Reset current size because we just perform a rotation. */ + stream->tracefile_size_current = 0; } stream->tracefile_size_current += len; }