X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=6be3ed9761f0b8d40a07deafcdc7bda0853f8be0;hb=3f84e025445a0cb91a16a89b0c932b5bbe614cfc;hp=6a692b9ba5a8bffd7826bd164dfc3f1de9f8c9df;hpb=72b6f5b6dc9fdd0ff4d49df8a9f010644311e863;p=lttng-tools.git diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 6a692b9ba..6be3ed976 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -399,7 +399,7 @@ static int send_sessiond_channel(int sock, struct lttng_consumer_channel *channel, struct lttng_consumer_local_data *ctx, int *relayd_error) { - int ret, ret_code = LTTNG_OK; + int ret, ret_code = LTTCOMM_CONSUMERD_SUCCESS; struct lttng_consumer_stream *stream; assert(channel); @@ -427,7 +427,7 @@ static int send_sessiond_channel(int sock, /* Inform sessiond that we are about to send channel and streams. */ ret = consumer_send_status_msg(sock, ret_code); - if (ret < 0 || ret_code != LTTNG_OK) { + if (ret < 0 || ret_code != LTTCOMM_CONSUMERD_SUCCESS) { /* * Either the session daemon is not responding or the relayd died so we * stop now. @@ -466,7 +466,7 @@ static int send_sessiond_channel(int sock, return 0; error: - if (ret_code != LTTNG_OK) { + if (ret_code != LTTCOMM_CONSUMERD_SUCCESS) { ret = -1; } return ret; @@ -615,7 +615,7 @@ error: */ static int _close_metadata(struct lttng_consumer_channel *channel) { - int ret = LTTNG_OK; + int ret = LTTCOMM_CONSUMERD_SUCCESS; assert(channel); assert(channel->type == CONSUMER_CHANNEL_TYPE_METADATA); @@ -1024,7 +1024,7 @@ int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, uint64_t len, struct lttng_consumer_channel *channel, int timer) { - int ret, ret_code = LTTNG_OK; + int ret, ret_code = LTTCOMM_CONSUMERD_SUCCESS; char *metadata_str; DBG("UST consumer push metadata key %" PRIu64 " of len %" PRIu64, key, len); @@ -1079,7 +1079,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, int sock, struct pollfd *consumer_sockpoll) { ssize_t ret; - enum lttng_error_code ret_code = LTTNG_OK; + enum lttcomm_return_code ret_code = LTTCOMM_CONSUMERD_SUCCESS; struct lttcomm_consumer_msg msg; struct lttng_consumer_channel *channel = NULL; @@ -1212,9 +1212,16 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, attr.switch_timer_interval = msg.u.ask_channel.switch_timer_interval; attr.read_timer_interval = msg.u.ask_channel.read_timer_interval; attr.chan_id = msg.u.ask_channel.chan_id; - attr.output = msg.u.ask_channel.output; memcpy(attr.uuid, msg.u.ask_channel.uuid, sizeof(attr.uuid)); + /* Match channel buffer type to the UST abi. */ + switch (msg.u.ask_channel.output) { + case LTTNG_EVENT_MMAP: + default: + attr.output = LTTNG_UST_MMAP; + break; + } + /* Translate and save channel type. */ switch (msg.u.ask_channel.type) { case LTTNG_UST_CHAN_PER_CPU: @@ -1389,7 +1396,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, } /* Tell session daemon we are ready to receive the metadata. */ - ret = consumer_send_status_msg(sock, LTTNG_OK); + ret = consumer_send_status_msg(sock, LTTCOMM_CONSUMERD_SUCCESS); if (ret < 0) { /* Somehow, the session daemon is not responding anymore. */ goto error_fatal; @@ -1868,7 +1875,7 @@ int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, { struct lttcomm_metadata_request_msg request; struct lttcomm_consumer_msg msg; - enum lttng_error_code ret_code = LTTNG_OK; + enum lttcomm_return_code ret_code = LTTCOMM_CONSUMERD_SUCCESS; uint64_t len, key, offset; int ret; @@ -1948,7 +1955,7 @@ int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, /* Tell session daemon we are ready to receive the metadata. */ ret = consumer_send_status_msg(ctx->consumer_metadata_socket, - LTTNG_OK); + LTTCOMM_CONSUMERD_SUCCESS); if (ret < 0 || len == 0) { /* * Somehow, the session daemon is not responding anymore or there is