X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.h;h=0f89d8eedc81dccc6548e12970b5a91b21dc5781;hb=9c9abe17599b58b2f8348c23f1dad263e5965cf8;hp=e50835e019f27176143ba857a572b52415c919f4;hpb=b7d17fdfe9a0f52c272b4d2640a8e9b4b396ac1a;p=lttng-tools.git diff --git a/src/common/consumer.h b/src/common/consumer.h index e50835e01..0f89d8eed 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -58,6 +58,7 @@ enum lttng_consumer_command { LTTNG_CONSUMER_SNAPSHOT_CHANNEL, LTTNG_CONSUMER_SNAPSHOT_METADATA, LTTNG_CONSUMER_STREAMS_SENT, + LTTNG_CONSUMER_CLEAR_QUIESCENT_CHANNEL, }; /* State of each fd in consumer */ @@ -238,6 +239,25 @@ struct lttng_consumer_stream { int data_read; int hangup_flush_done; + /* + * Whether the stream is in a "complete" state (e.g. it does not have a + * partially written sub-buffer. + * + * Initialized to "false" on stream creation (first packet is empty). + * + * The various transitions of the quiescent state are: + * - On "start" tracing: set to false, since the stream is not + * "complete". + * - On "stop" tracing: if !quiescent -> flush FINAL (update + * timestamp_end), and set to true; the stream has entered a + * complete/quiescent state. + * - On "destroy" or stream/application hang-up: if !quiescent -> + * flush FINAL, and set to true. + * + * NOTE: Update and read are protected by the stream lock. + */ + bool quiescent; + /* * metadata_timer_lock protects flags waiting_on_metadata and * missed_metadata_flush.