Dedicated error message when relay does not support rotations
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 26 Jan 2018 21:56:52 +0000 (16:56 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 Apr 2018 16:12:29 +0000 (12:12 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/lttng-error.h
src/bin/lttng-sessiond/cmd.c
src/common/error.c

index 1fb773806dbcb6924762572e1232e7b12e6fdecc..36602448de7288c13b5ee1931d707811198de06e 100644 (file)
@@ -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_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 */
 
        /* MUST be last element */
        LTTNG_ERR_NR,                           /* Last element */
index bdc6db89d5e9d303417f992ce2d12dbd4087ed7c..e0a8db9b2cc13a2b5c77407e0b14938fa565a587 100644 (file)
@@ -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)) {
        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;
        }
 
                goto end;
        }
 
index 69ba785d11182adce51965ab642a6f69d0e51386..a8256ff101ba3ed9d8fc8be5d56651c02c484af2 100644 (file)
@@ -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_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"
 
        /* Last element */
        [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"
This page took 0.028544 seconds and 4 git commands to generate.