From: Julien Desfossez Date: Fri, 26 Jan 2018 21:56:52 +0000 (-0500) Subject: Dedicated error message when relay does not support rotations X-Git-Tag: v2.11.0-rc1~306 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=504521ea8462dbd9c188a59c4d04a1f5a0c4c537;hp=3ae5c539f96856c83f3f17fbc37660d23462e3e5 Dedicated error message when relay does not support rotations Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- 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"