From: David Goulet Date: Thu, 22 Nov 2012 16:54:50 +0000 (-0500) Subject: Add already enabled UST event error code X-Git-Tag: v2.1.0-rc8~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5bcdda4ff7e938d320b497470c8c33c84e996370;p=lttng-tools.git Add already enabled UST event error code Return this error if the event is already enabled when found during an enable event command. Signed-off-by: David Goulet --- diff --git a/include/lttng/lttng-error.h b/include/lttng/lttng-error.h index 26f05ab4a..9cb74a122 100644 --- a/include/lttng/lttng-error.h +++ b/include/lttng/lttng-error.h @@ -75,7 +75,7 @@ enum lttng_error_code { /* 52 */ LTTNG_ERR_KERN_LIST_FAIL = 53, /* Kernel listing events failed */ LTTNG_ERR_UST_CALIBRATE_FAIL = 54, /* UST calibration failed */ - /* 55 */ + LTTNG_ERR_UST_EVENT_ENABLED = 55, /* UST event already enabled. */ LTTNG_ERR_UST_SESS_FAIL = 56, /* UST create session failed */ LTTNG_ERR_UST_CHAN_EXIST = 57, /* UST channel already exist */ LTTNG_ERR_UST_CHAN_FAIL = 58, /* UST create channel failed */ diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 402a386ce..0fec563ad 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -429,7 +429,7 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, int domain, if (uevent->enabled) { /* It's already enabled so everything is OK */ - ret = LTTNG_OK; + ret = LTTNG_ERR_UST_EVENT_ENABLED; goto end; } diff --git a/src/common/error.c b/src/common/error.c index 0a3b5b3e1..e73cf17f6 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -101,6 +101,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_NO_SESSIOND) ] = "No session daemon is available", [ ERROR_INDEX(LTTNG_ERR_SESSION_STARTED) ] = "Session is running", [ ERROR_INDEX(LTTNG_ERR_NOT_SUPPORTED) ] = "Operation not supported", + [ ERROR_INDEX(LTTNG_ERR_UST_EVENT_ENABLED) ] = "UST event already enabled", /* Last element */ [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"