Skip to contentSkip to conversation

Fix: reset out_fd_offset when we rotate the trace file

PATCH Mathieu Desnoyers 2 participants 2 messages Aug 13, 2013 – Aug 15, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Acked-by
#1 lore raw
Quoted 7 lines · * Julien Desfossez ([email protected]) wrote:

This value is only used for the sync_file_range, but it has to be set to 0 when we start to write in a new trace file, otherwise the values passed to this call are bogus.

Applied to 2.3, but could probably be backported to 2.2.

Quoted 34 lines
---
 src/common/consumer.c |    4 ++++
 1 file changed, 4 insertions(+)
src/common/consumer.c +4 -0
index 221c348..59207da 100644
@@ -1431,6 +1431,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap(
 			outfd = stream->out_fd = ret;
 			/* Reset current size because we just perform a rotation. */
 			stream->tracefile_size_current = 0;
+			stream->out_fd_offset = 0;
+			orig_offset = 0;
 		}
 		stream->tracefile_size_current += len;
 	}
@@ -1614,6 +1616,8 @@ ssize_t lttng_consumer_on_read_subbuffer_splice(
 			outfd = stream->out_fd = ret;
 			/* Reset current size because we just perform a rotation. */
 			stream->tracefile_size_current = 0;
+			stream->out_fd_offset = 0;
+			orig_offset = 0;
 		}
 		stream->tracefile_size_current += len;
 	}
Signature · 7 lines
1.7.10.4


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
#2 lore raw
In reply to a message not in the archive

Merged!

Backported to 2.2 as well.

Julien Desfossez:

Quoted 33 lines

This value is only used for the sync_file_range, but it has to be set to 0 when we start to write in a new trace file, otherwise the values passed to this call are bogus.

Applied to 2.3, but could probably be backported to 2.2.

---
 src/common/consumer.c |    4 ++++
 1 file changed, 4 insertions(+)
src/common/consumer.c +4 -0
index 221c348..59207da 100644
@@ -1431,6 +1431,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap(
 			outfd = stream->out_fd = ret;
 			/* Reset current size because we just perform a rotation. */
 			stream->tracefile_size_current = 0;
+			stream->out_fd_offset = 0;
+			orig_offset = 0;
 		}
 		stream->tracefile_size_current += len;
 	}
@@ -1614,6 +1616,8 @@ ssize_t lttng_consumer_on_read_subbuffer_splice(
 			outfd = stream->out_fd = ret;
 			/* Reset current size because we just perform a rotation. */
 			stream->tracefile_size_current = 0;
+			stream->out_fd_offset = 0;
+			orig_offset = 0;
 		}
 		stream->tracefile_size_current += len;
 	}