Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jdesfossez@efficios.com (Julien Desfossez)
Subject: [lttng-dev] [BABELTRACE PATCH 2/3] Handle packets containing only a header
Date: Wed, 27 Nov 2013 11:40:11 -0500	[thread overview]
Message-ID: <1385570412-31370-2-git-send-email-jdesfossez@efficios.com> (raw)
In-Reply-To: <1385570412-31370-1-git-send-email-jdesfossez@efficios.com>

In live streaming with LTTng, if we do a stop and then a destroy, we
receive a packet that contains only a header. With this patch, we will
ask for a new packet when we see this case.

Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
 formats/ctf/ctf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c
index 5f263cd..5cf8097 100644
--- a/formats/ctf/ctf.c
+++ b/formats/ctf/ctf.c
@@ -476,6 +476,10 @@ int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *str
 		/* Stream is inactive for now (live reading). */
 		return EAGAIN;
 	}
+	/* Packet only contains headers */
+	if (pos->offset == pos->content_size)
+		return EAGAIN;
+
 	assert(pos->offset < pos->content_size);
 
 	/* Read event header */
-- 
1.8.3.2




  reply	other threads:[~2013-11-27 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 16:40 [lttng-dev] [BABELTRACE PATCH 1/3] Handle the inactive streams Julien Desfossez
2013-11-27 16:40 ` Julien Desfossez [this message]
2013-11-27 16:40 ` [lttng-dev] [BABELTRACE PATCH 3/3] Handle empty streams on iterator init Julien Desfossez
2013-11-27 17:41   ` Mathieu Desnoyers
  -- strict thread matches above, loose matches on Subject: below --
2013-11-27 15:06 [lttng-dev] [BABELTRACE PATCH 1/3] Handle the inactive streams Julien Desfossez
2013-11-27 15:06 ` [lttng-dev] [BABELTRACE PATCH 2/3] Handle packets containing only a header Julien Desfossez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385570412-31370-2-git-send-email-jdesfossez@efficios.com \
    --to=jdesfossez@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox