X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.c;h=c043353b9e82b078d235aa55a0b90f85d452fb73;hb=317ea246af2890928a75913db461ff2f417e518c;hp=b649d198aaad9c49ed139eb7d2520ce1c28f5373;hpb=ab5be9fa2eb5ba9600a82cd18fd3cfcbac69169a;p=lttng-tools.git diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index b649d198a..c043353b9 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -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; @@ -4193,7 +4203,7 @@ int consumer_clear_buffer(struct lttng_consumer_stream *stream) case LTTNG_CONSUMER_KERNEL: ret = kernctl_buffer_clear(stream->wait_fd); if (ret < 0) { - ERR("Failed to flush kernel stream"); + ERR("Failed to clear kernel stream (ret = %d)", ret); goto end; } break; @@ -4272,11 +4282,6 @@ error_unlock: pthread_mutex_unlock(&stream->lock); pthread_mutex_unlock(&channel->lock); rcu_read_unlock(); - if (ret) { - goto error; - } - ret = LTTCOMM_CONSUMERD_SUCCESS; -error: return ret; }