Fix: don't do 0 byte event reservation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Jun 2013 17:55:31 +0000 (13:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Jun 2013 17:55:31 +0000 (13:55 -0400)
Caused sequence of:

lttng create
lttng enable-event -k sched_switch
lttng start
lttng stop
lttng start
lttng stop

to hang on waiting for data......

Issue appeared in

commit d83004aa718065e5221d8ef4b99e4302b70b3df9
Author: Julien Desfossez <jdesfossez@efficios.com>
Date:   Thu Jun 6 16:38:48 2013 -0400

    Metadata cache and multiple metadata channels

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-events.c

index faf3e1f0f8f76785ebcc8b9d0baa170f113817e9..27a8f8644477be0bcf41c3732622e0e8c0f9fa57 100644 (file)
@@ -563,6 +563,8 @@ int lttng_metadata_output_channel(struct lttng_channel *chan,
 
        len = stream->metadata_cache->metadata_written -
                stream->metadata_cache_read;
+       if (!len)
+               return 0;
        reserve_len = min_t(size_t,
                        chan->ops->packet_avail_size(chan->chan),
                        len);
This page took 0.026684 seconds and 4 git commands to generate.