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>
Fri, 20 Dec 2019 00:24:40 +0000 (19:24 -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 c36d6c437914ded256d02e1d21f7f01de2274f6c..e27161e436cecce180b32ca31231ad35ee6b0f59 100644 (file)
@@ -3944,15 +3944,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.026536 seconds and 4 git commands to generate.