X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.h;h=1e378f04ea631ea4387a1940c407599d19a63966;hb=a2361a610dc8201cc8e165a70682b2f6dc3e0aee;hp=84ef2719d47e55eb7abc8626cdf37b3a11da525c;hpb=6d574024f868e661ae688ecbc47a110a1311c57e;p=lttng-tools.git diff --git a/src/common/consumer.h b/src/common/consumer.h index 84ef2719d..1e378f04e 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -41,7 +41,7 @@ enum lttng_consumer_command { /* pause, delete, active depending on fd state */ LTTNG_CONSUMER_UPDATE_STREAM, /* inform the consumer to quit when all fd has hang up */ - LTTNG_CONSUMER_STOP, + LTTNG_CONSUMER_STOP, /* deprecated */ LTTNG_CONSUMER_ADD_RELAYD_SOCKET, /* Inform the consumer to kill a specific relayd connection */ LTTNG_CONSUMER_DESTROY_RELAYD, @@ -336,11 +336,19 @@ struct lttng_consumer_stream { */ int index_fd; + /* + * Local pipe to extract data when using splice. + */ + int splice_pipe[2]; + /* * Rendez-vous point between data and metadata stream in live mode. */ pthread_cond_t metadata_rdv; pthread_mutex_t metadata_rdv_lock; + + /* Indicate if the stream still has some data to be read. */ + unsigned int has_data:1; }; /* @@ -448,11 +456,22 @@ struct lttng_consumer_local_data { /* socket to exchange commands with sessiond */ char *consumer_command_sock_path; /* communication with splice */ - int consumer_thread_pipe[2]; int consumer_channel_pipe[2]; - int consumer_splice_metadata_pipe[2]; /* Data stream poll thread pipe. To transfer data stream to the thread */ struct lttng_pipe *consumer_data_pipe; + + /* + * Data thread use that pipe to catch wakeup from read subbuffer that + * detects that there is still data to be read for the stream encountered. + * Before doing so, the stream is flagged to indicate that there is still + * data to be read. + * + * Both pipes (read/write) are owned and used inside the data thread. + */ + struct lttng_pipe *consumer_wakeup_pipe; + /* Indicate if the wakeup thread has been notified. */ + unsigned int has_wakeup:1; + /* to let the signal handler wake up the fd receiver thread */ int consumer_should_quit[2]; /* Metadata poll thread pipe. Transfer metadata stream to it */