static enum lttng_consumer_type opt_type = LTTNG_CONSUMER_KERNEL;
/* the liblttngconsumerd context */
-static struct lttng_consumer_local_data *ctx;
+static struct lttng_consumer_local_data *the_consumer_context;
/* Consumerd health monitoring */
struct health_app *health_consumerd;
enum lttng_consumer_type lttng_consumer_get_type(void)
{
- if (!ctx) {
+ if (!the_consumer_context) {
return LTTNG_CONSUMER_UNKNOWN;
}
- return ctx->type;
+ return the_consumer_context->type;
}
/*
abort();
}
- if (ctx) {
- lttng_consumer_should_exit(ctx);
+ if (the_consumer_context) {
+ lttng_consumer_should_exit(the_consumer_context);
}
}
}
/* create the consumer instance with and assign the callbacks */
- ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
+ the_consumer_context = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
NULL, lttng_consumer_on_recv_stream, NULL);
- if (!ctx) {
+ if (!the_consumer_context) {
retval = -1;
goto exit_init_data;
}
- lttng_consumer_set_command_sock_path(ctx, command_sock_path);
+ lttng_consumer_set_command_sock_path(the_consumer_context, command_sock_path);
if (*error_sock_path == '\0') {
switch (opt_type) {
case LTTNG_CONSUMER_KERNEL:
if (ret < 0) {
WARN("Cannot connect to error socket (is lttng-sessiond started?)");
}
- lttng_consumer_set_error_sock(ctx, ret);
+ lttng_consumer_set_error_sock(the_consumer_context, ret);
/*
* Block RT signals used for UST periodical metadata flush and the live
goto exit_init_data;
}
- ctx->type = opt_type;
+ the_consumer_context->type = opt_type;
if (utils_create_pipe(health_quit_pipe)) {
retval = -1;
* live timer.
*/
ret = pthread_create(&metadata_timer_thread, NULL,
- consumer_timer_thread, (void *) ctx);
+ consumer_timer_thread, (void *) the_consumer_context);
if (ret) {
errno = ret;
PERROR("pthread_create");
/* Create thread to manage channels */
ret = pthread_create(&channel_thread, default_pthread_attr(),
consumer_thread_channel_poll,
- (void *) ctx);
+ (void *) the_consumer_context);
if (ret) {
errno = ret;
PERROR("pthread_create");
/* Create thread to manage the polling/writing of trace metadata */
ret = pthread_create(&metadata_thread, default_pthread_attr(),
consumer_thread_metadata_poll,
- (void *) ctx);
+ (void *) the_consumer_context);
if (ret) {
errno = ret;
PERROR("pthread_create");
/* Create thread to manage the polling/writing of trace data */
ret = pthread_create(&data_thread, default_pthread_attr(),
- consumer_thread_data_poll, (void *) ctx);
+ consumer_thread_data_poll, (void *) the_consumer_context);
if (ret) {
errno = ret;
PERROR("pthread_create");
/* Create the thread to manage the reception of fds */
ret = pthread_create(&sessiond_thread, default_pthread_attr(),
consumer_thread_sessiond_poll,
- (void *) ctx);
+ (void *) the_consumer_context);
if (ret) {
errno = ret;
PERROR("pthread_create");
}
metadata_timer_thread_online = false;
}
- tmp_ctx = ctx;
- ctx = NULL;
+ tmp_ctx = the_consumer_context;
+ the_consumer_context = NULL;
cmm_barrier(); /* Clear ctx for signal handler. */
lttng_consumer_destroy(tmp_ctx);