X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-timer.h;h=22e74574ce5622d7ec7e242b83865fa766b1f639;hp=84061587f04ddd4a06f6234860bd0147a3b62ac4;hb=790c779e5d45e5ea024c221e60d3dd2277a7b7b9;hpb=331744e34f56a5aec69b05d356d6901e67926acc diff --git a/src/common/consumer-timer.h b/src/common/consumer-timer.h index 84061587f..22e74574c 100644 --- a/src/common/consumer-timer.h +++ b/src/common/consumer-timer.h @@ -26,24 +26,33 @@ #define LTTNG_CONSUMER_SIG_SWITCH SIGRTMIN + 10 #define LTTNG_CONSUMER_SIG_TEARDOWN SIGRTMIN + 11 +#define LTTNG_CONSUMER_SIG_LIVE SIGRTMIN + 12 #define CLOCKID CLOCK_MONOTONIC /* * Handle timer teardown race wrt memory free of private data by consumer * signals are handled by a single thread, which permits a synchronization - * point between handling of each signal. + * point between handling of each signal. Internal lock ensures mutual + * exclusion. */ struct timer_signal_data { pthread_t tid; /* thread id managing signals */ int setup_done; int qs_done; + pthread_mutex_t lock; }; void consumer_timer_switch_start(struct lttng_consumer_channel *channel, unsigned int switch_timer_interval); void consumer_timer_switch_stop(struct lttng_consumer_channel *channel); -void *consumer_timer_metadata_thread(void *data); -void consumer_signal_init(void); +void consumer_timer_live_start(struct lttng_consumer_channel *channel, + int live_timer_interval); +void consumer_timer_live_stop(struct lttng_consumer_channel *channel); +void *consumer_timer_thread(void *data); +int consumer_signal_init(void); + +int consumer_flush_kernel_index(struct lttng_consumer_stream *stream); +int consumer_flush_ust_index(struct lttng_consumer_stream *stream); #endif /* CONSUMER_TIMER_H */