Fix: reset current size for tracefile rotation
authorDavid Goulet <dgoulet@efficios.com>
Mon, 6 May 2013 15:04:21 +0000 (11:04 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 6 May 2013 15:25:01 +0000 (11:25 -0400)
Fixes #514

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c
src/common/consumer.c

index 156fc83ee6d534599bbb6d44a1b747099eeb08c2..71c9f2b49105ac665faf805c444d7ef6a984b548 100644 (file)
@@ -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 {
index c4518cc03a7d8891715704cd40a8983f50d08650..01266a700cb37199966c9257eba335689e877453 100644 (file)
@@ -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;
        }
This page took 0.028685 seconds and 4 git commands to generate.