From 504521ea8462dbd9c188a59c4d04a1f5a0c4c537 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 26 Jan 2018 16:56:52 -0500 Subject: [PATCH 1/1] Dedicated error message when relay does not support rotations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- include/lttng/lttng-error.h | 1 + src/bin/lttng-sessiond/cmd.c | 2 +- src/common/error.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/lttng/lttng-error.h b/include/lttng/lttng-error.h index 1fb773806..36602448d 100644 --- a/include/lttng/lttng-error.h +++ b/include/lttng/lttng-error.h @@ -158,6 +158,7 @@ enum lttng_error_code { LTTNG_ERR_ROTATION_MULTIPLE_AFTER_STOP = 135, /* Already rotated once after a stop. */ LTTNG_ERR_ROTATION_WRONG_VERSION = 136, /* Session rotation not supported by this kernel tracer version */ LTTNG_ERR_NO_SESSION_OUTPUT = 137, /* Session has no output configured. */ + LTTNG_ERR_ROTATION_NOT_AVAILABLE_RELAY = 138, /* Rotate feature not available on the relay. */ /* MUST be last element */ LTTNG_ERR_NR, /* Last element */ diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index bdc6db89d..e0a8db9b2 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4406,7 +4406,7 @@ int cmd_rotate_session(struct ltt_session *session, if (session->consumer->type == CONSUMER_DST_NET && (session->consumer->relay_major_version == 2 && session->consumer->relay_minor_version < 11)) { - ret = -LTTNG_ERR_ROTATION_NOT_AVAILABLE; + ret = -LTTNG_ERR_ROTATION_NOT_AVAILABLE_RELAY; goto end; } diff --git a/src/common/error.c b/src/common/error.c index 69ba785d1..a8256ff10 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -199,6 +199,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_ROTATION_MULTIPLE_AFTER_STOP) ] = "Session was already rotated once since it became inactive", [ ERROR_INDEX(LTTNG_ERR_ROTATION_WRONG_VERSION) ] = "Session rotation is not supported by this kernel tracer version", [ ERROR_INDEX(LTTNG_ERR_NO_SESSION_OUTPUT) ] = "Session has no output", + [ ERROR_INDEX(LTTNG_ERR_ROTATION_NOT_AVAILABLE_RELAY) ] = "Rotation feature not available on the relay", /* Last element */ [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code" -- 2.34.1