Fix: consumer: honor "active" flush flag
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 12 Dec 2019 18:07:18 +0000 (13:07 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Dec 2019 22:14:59 +0000 (17:14 -0500)
Honor "active" flush flag in both kernel and ust consumers. A flush
"active" does a flush which will not generate empty packets (no event),
whereas an "inactive" flush will generate empty packets if flushing
a current packet which has no event.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Icc9772ba3ae18e96f24354ac6eb9223f343c3458
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer/consumer.c

index d81d0fc7a1da1bf0f57c3a670b216f95fdc7af68..5a39a0cc7e22822154ed2c6da334df0c1693355f 100644 (file)
@@ -3940,15 +3940,23 @@ int consumer_flush_buffer(struct lttng_consumer_stream *stream, int producer_act
 
        switch (consumer_data.type) {
        case LTTNG_CONSUMER_KERNEL:
-               ret = kernctl_buffer_flush(stream->wait_fd);
-               if (ret < 0) {
-                       ERR("Failed to flush kernel stream");
-                       goto end;
+               if (producer_active) {
+                       ret = kernctl_buffer_flush(stream->wait_fd);
+                       if (ret < 0) {
+                               ERR("Failed to flush kernel stream");
+                               goto end;
+                       }
+               } else {
+                       ret = kernctl_buffer_flush_empty(stream->wait_fd);
+                       if (ret < 0) {
+                               ERR("Failed to flush kernel stream");
+                               goto end;
+                       }
                }
                break;
        case LTTNG_CONSUMER32_UST:
        case LTTNG_CONSUMER64_UST:
-               lttng_ustctl_flush_buffer(stream, producer_active);
+               lttng_ustconsumer_flush_buffer(stream, producer_active);
                break;
        default:
                ERR("Unknown consumer_data type");
This page took 0.037705 seconds and 5 git commands to generate.