X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.h;h=bedc8885dbc97e6c67faa5f5d5a41917eabf7531;hb=7f12ef5d1b1de751b90c2e88fa331692a998ed70;hp=3a0c6c8d8f5e3a737e9ce6da64c3fb4e09c4dd21;hpb=a9838785aecf564595c531772f7ca906b658afa0;p=lttng-tools.git diff --git a/src/common/consumer.h b/src/common/consumer.h index 3a0c6c8d8..bedc8885d 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -172,12 +172,29 @@ struct lttng_consumer_channel { /* * Channel lock. * + * This lock protects against concurrent update of channel. + * * This is nested INSIDE the consumer data lock. + * This is nested OUTSIDE the channel timer lock. * This is nested OUTSIDE the metadata cache lock. * This is nested OUTSIDE stream lock. * This is nested OUTSIDE consumer_relayd_sock_pair lock. */ pthread_mutex_t lock; + + /* + * Channel teardown lock. + * + * This lock protect against teardown of channel. It is _never_ + * taken by the timer handler. + * + * This is nested INSIDE the consumer data lock. + * This is nested INSIDE the channel lock. + * This is nested OUTSIDE the metadata cache lock. + * This is nested OUTSIDE stream lock. + * This is nested OUTSIDE consumer_relayd_sock_pair lock. + */ + pthread_mutex_t timer_lock; }; /* @@ -258,6 +275,7 @@ struct lttng_consumer_stream { * This is nested INSIDE the consumer_data lock. * This is nested INSIDE the metadata cache lock. * This is nested INSIDE the channel lock. + * This is nested INSIDE the channel timer lock. * This is nested OUTSIDE consumer_relayd_sock_pair lock. */ pthread_mutex_t lock; @@ -290,6 +308,16 @@ struct lttng_consumer_stream { * acquired in the destroy path. */ unsigned int globally_visible; + /* + * Pipe to wake up the metadata poll thread when the UST metadata + * cache is updated. + */ + int ust_metadata_poll_pipe[2]; + /* + * How much metadata was read from the metadata cache and sent + * to the channel. + */ + uint64_t ust_metadata_pushed; }; /* @@ -386,8 +414,14 @@ struct lttng_consumer_local_data { enum lttng_consumer_type type; /* socket to communicate errors with sessiond */ int consumer_error_socket; - /* socket to ask metadata to sessiond */ + /* socket to ask metadata to sessiond. */ int consumer_metadata_socket; + /* + * Protect consumer_metadata_socket. + * + * This is nested OUTSIDE the metadata cache lock. + */ + pthread_mutex_t metadata_socket_lock; /* socket to exchange commands with sessiond */ char *consumer_command_sock_path; /* communication with splice */