Fix: consumer: fallback to flush when flush empty is unsupported
[lttng-tools.git] / src / common / consumer / consumer.c
index 4613284a8d5d6c29afd0c0fa17a725037c0b2f66..c043353b9e82b078d235aa55a0b90f85d452fb73 100644 (file)
@@ -3953,8 +3953,18 @@ int consumer_flush_buffer(struct lttng_consumer_stream *stream, int producer_act
                } else {
                        ret = kernctl_buffer_flush_empty(stream->wait_fd);
                        if (ret < 0) {
-                               ERR("Failed to flush kernel stream");
-                               goto end;
+                               /*
+                                * Doing a buffer flush which does not take into
+                                * account empty packets. This is not perfect,
+                                * but required as a fall-back when
+                                * "flush_empty" is not implemented by
+                                * lttng-modules.
+                                */
+                               ret = kernctl_buffer_flush(stream->wait_fd);
+                               if (ret < 0) {
+                                       ERR("Failed to flush kernel stream");
+                                       goto end;
+                               }
                        }
                }
                break;
This page took 0.033456 seconds and 4 git commands to generate.