Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-tools 1/2] Fix: implicit conversion of enum types in consumer
@ 2014-02-25 15:41 Zifei Tong
  2014-02-25 15:41 ` [lttng-dev] [PATCH lttng-tools 2/2] Add missing error message for lttcomm_return_code Zifei Tong
  0 siblings, 1 reply; 2+ messages in thread
From: Zifei Tong @ 2014-02-25 15:41 UTC (permalink / raw)


Fix implicit conversions from enumeration type 'enum lttng_error_code'
to enumeration type 'enum lttcomm_return_code' found by clang.

Signed-off-by: Zifei Tong <soariez at gmail.com>
---
 src/common/kernel-consumer/kernel-consumer.c | 12 ++++++------
 src/common/ust-consumer/ust-consumer.c       |  8 ++++----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c
index ab4f604..388ef11 100644
--- a/src/common/kernel-consumer/kernel-consumer.c
+++ b/src/common/kernel-consumer/kernel-consumer.c
@@ -561,7 +561,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 			 * happens while tearing down.
 			 */
 			ERR("Unable to find channel key %" PRIu64, msg.u.stream.channel_key);
-			ret_code = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 		}
 
 		health_code_update();
@@ -764,7 +764,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 			 */
 			ERR("Unable to find channel key %" PRIu64,
 					msg.u.sent_streams.channel_key);
-			ret_code = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 		}
 
 		health_code_update();
@@ -815,7 +815,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		relayd = consumer_find_relayd(index);
 		if (relayd == NULL) {
 			DBG("Unable to find relayd %" PRIu64, index);
-			ret_code = LTTNG_ERR_NO_CONSUMER;
+			ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
 		}
 
 		/*
@@ -874,7 +874,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					msg.u.snapshot_channel.relayd_id, ctx);
 			if (ret < 0) {
 				ERR("Snapshot metadata failed");
-				ret_code = LTTNG_ERR_KERN_META_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_ERROR_METADATA;
 			}
 		} else {
 			ret = lttng_kconsumer_snapshot_channel(msg.u.snapshot_channel.key,
@@ -884,7 +884,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					ctx);
 			if (ret < 0) {
 				ERR("Snapshot channel failed");
-				ret_code = LTTNG_ERR_KERN_CHAN_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 			}
 		}
 
@@ -905,7 +905,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		channel = consumer_find_channel(key);
 		if (!channel) {
 			ERR("Kernel consumer destroy channel %" PRIu64 " not found", key);
-			ret_code = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 		}
 
 		health_code_update();
diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
index 0955e66..d19ce57 100644
--- a/src/common/ust-consumer/ust-consumer.c
+++ b/src/common/ust-consumer/ust-consumer.c
@@ -1145,7 +1145,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		relayd = consumer_find_relayd(index);
 		if (relayd == NULL) {
 			DBG("Unable to find relayd %" PRIu64, index);
-			ret_code = LTTNG_ERR_NO_CONSUMER;
+			ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
 		}
 
 		/*
@@ -1326,7 +1326,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		channel = consumer_find_channel(key);
 		if (!channel) {
 			ERR("UST consumer get channel key %" PRIu64 " not found", key);
-			ret_code = LTTNG_ERR_UST_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 			goto end_msg_sessiond;
 		}
 
@@ -1482,7 +1482,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					ctx);
 			if (ret < 0) {
 				ERR("Snapshot metadata failed");
-				ret_code = LTTNG_ERR_UST_META_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_ERROR_METADATA;
 			}
 		} else {
 			ret = snapshot_channel(msg.u.snapshot_channel.key,
@@ -1492,7 +1492,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					ctx);
 			if (ret < 0) {
 				ERR("Snapshot channel failed");
-				ret_code = LTTNG_ERR_UST_CHAN_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 			}
 		}
 
-- 
1.8.3.4 (Apple Git-47)




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [lttng-dev] [PATCH lttng-tools 2/2] Add missing error message for lttcomm_return_code
  2014-02-25 15:41 [lttng-dev] [PATCH lttng-tools 1/2] Fix: implicit conversion of enum types in consumer Zifei Tong
@ 2014-02-25 15:41 ` Zifei Tong
  0 siblings, 0 replies; 2+ messages in thread
From: Zifei Tong @ 2014-02-25 15:41 UTC (permalink / raw)


Signed-off-by: Zifei Tong <soariez at gmail.com>
---
 src/common/sessiond-comm/sessiond-comm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/common/sessiond-comm/sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c
index 65952b2..05483ff 100644
--- a/src/common/sessiond-comm/sessiond-comm.c
+++ b/src/common/sessiond-comm/sessiond-comm.c
@@ -67,6 +67,7 @@ static const char *lttcomm_readable_code[] = {
 	[ LTTCOMM_ERR_INDEX(LTTCOMM_CONSUMERD_ERROR_METADATA) ] = "Error with metadata",
 	[ LTTCOMM_ERR_INDEX(LTTCOMM_CONSUMERD_FATAL) ] = "Fatal error",
 	[ LTTCOMM_ERR_INDEX(LTTCOMM_CONSUMERD_RELAYD_FAIL) ] = "Error on remote relayd",
+	[ LTTCOMM_ERR_INDEX(LTTCOMM_CONSUMERD_CHANNEL_FAIL) ] = "Channel creation failed",
 
 	/* Last element */
 	[ LTTCOMM_ERR_INDEX(LTTCOMM_NR) ] = "Unknown error code"
-- 
1.8.3.4 (Apple Git-47)




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-25 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-25 15:41 [lttng-dev] [PATCH lttng-tools 1/2] Fix: implicit conversion of enum types in consumer Zifei Tong
2014-02-25 15:41 ` [lttng-dev] [PATCH lttng-tools 2/2] Add missing error message for lttcomm_return_code Zifei Tong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox