From 1ab1ea0b77d5fc71765e06b5c84431e403e8bd2e Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 23 Jan 2012 16:55:40 -0500 Subject: [PATCH] Change not implemented error to undefined. Aiming to a stable release, "not implemented" message are not a good idea for user to see. Signed-off-by: David Goulet --- src/bin/lttng-sessiond/channel.c | 6 +++--- src/bin/lttng-sessiond/context.c | 6 +++--- src/bin/lttng-sessiond/event.c | 8 ++++---- src/bin/lttng-sessiond/main.c | 20 ++++++++++---------- src/bin/lttng/command.h | 1 - src/bin/lttng/commands/add_context.c | 2 +- src/bin/lttng/commands/calibrate.c | 14 +++++++------- src/bin/lttng/commands/disable_channels.c | 2 +- src/bin/lttng/commands/disable_events.c | 4 ++-- src/bin/lttng/commands/enable_channels.c | 2 +- src/bin/lttng/commands/enable_events.c | 8 ++++---- src/bin/lttng/lttng.c | 3 --- 12 files changed, 36 insertions(+), 40 deletions(-) diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 23b3b1fee..54345d9c9 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -194,7 +194,7 @@ int channel_ust_enable(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_EXEC_NAME: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -256,7 +256,7 @@ int channel_ust_create(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_EXEC_NAME: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error_free_chan; } @@ -313,7 +313,7 @@ int channel_ust_disable(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_PID: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } diff --git a/src/bin/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c index bbed1e767..0e7acefdb 100644 --- a/src/bin/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -174,7 +174,7 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess, int domain, } break; default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -213,7 +213,7 @@ static int add_uctx_to_event(struct ltt_ust_session *usess, int domain, } break; default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -298,7 +298,7 @@ int context_ust_add(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 0a82372bd..7cffe9820 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -340,7 +340,7 @@ int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -409,7 +409,7 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto end; } @@ -478,7 +478,7 @@ int event_ust_disable_tracepoint(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -551,7 +551,7 @@ int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 1b837c1fc..023ad48b9 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2295,7 +2295,7 @@ static int cmd_disable_event(struct ltt_session *session, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2364,7 +2364,7 @@ static int cmd_disable_event_all(struct ltt_session *session, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2407,7 +2407,7 @@ static int cmd_add_context(struct ltt_session *session, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2524,7 +2524,7 @@ static int cmd_enable_event(struct ltt_session *session, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2661,7 +2661,7 @@ static int cmd_enable_event_all(struct ltt_session *session, int domain, case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: #endif default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2695,7 +2695,7 @@ static ssize_t cmd_list_tracepoints(int domain, struct lttng_event **events) } break; default: - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2926,7 +2926,7 @@ static int cmd_calibrate(int domain, struct lttng_calibrate *calibrate) } default: /* TODO: Userspace tracing */ - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -2962,7 +2962,7 @@ static int cmd_register_consumer(struct ltt_session *session, int domain, break; default: /* TODO: Userspace tracing */ - ret = LTTCOMM_NOT_IMPLEMENTED; + ret = LTTCOMM_UND; goto error; } @@ -3038,7 +3038,7 @@ static ssize_t cmd_list_channels(int domain, struct ltt_session *session, break; default: *channels = NULL; - ret = -LTTCOMM_NOT_IMPLEMENTED; + ret = -LTTCOMM_UND; goto error; } @@ -3085,7 +3085,7 @@ static ssize_t cmd_list_events(int domain, struct ltt_session *session, break; } default: - ret = -LTTCOMM_NOT_IMPLEMENTED; + ret = -LTTCOMM_UND; goto error; } diff --git a/src/bin/lttng/command.h b/src/bin/lttng/command.h index 887502bf0..09ce7c0eb 100644 --- a/src/bin/lttng/command.h +++ b/src/bin/lttng/command.h @@ -30,7 +30,6 @@ enum cmd_error_code { CMD_SUCCESS, CMD_ERROR, CMD_UNDEFINED, - CMD_NOT_IMPLEMENTED, CMD_FATAL, }; diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index 95fefa50c..260c300be 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -368,7 +368,7 @@ static int add_context(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } diff --git a/src/bin/lttng/commands/calibrate.c b/src/bin/lttng/commands/calibrate.c index 023ea100e..485cae135 100644 --- a/src/bin/lttng/commands/calibrate.c +++ b/src/bin/lttng/commands/calibrate.c @@ -154,11 +154,11 @@ static int calibrate_lttng(void) DBG("Calibrating kernel syscall"); break; default: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto end; } } else if (opt_userspace) { /* User-space tracer action */ - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto end; } else { ERR("Please specify a tracer (--kernel or --userspace)"); @@ -193,22 +193,22 @@ int cmd_calibrate(int argc, const char **argv) ret = CMD_SUCCESS; goto end; case OPT_TRACEPOINT: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; break; case OPT_MARKER: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto end; case OPT_PROBE: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; break; case OPT_FUNCTION: opt_event_type = LTTNG_EVENT_FUNCTION; break; case OPT_FUNCTION_ENTRY: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; break; case OPT_SYSCALL: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; break; case OPT_USERSPACE: opt_userspace = 1; diff --git a/src/bin/lttng/commands/disable_channels.c b/src/bin/lttng/commands/disable_channels.c index cc81b74c9..f8ed51759 100644 --- a/src/bin/lttng/commands/disable_channels.c +++ b/src/bin/lttng/commands/disable_channels.c @@ -96,7 +96,7 @@ static int disable_channels(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } diff --git a/src/bin/lttng/commands/disable_events.c b/src/bin/lttng/commands/disable_events.c index e6c8b2d06..7446168d2 100644 --- a/src/bin/lttng/commands/disable_events.c +++ b/src/bin/lttng/commands/disable_events.c @@ -120,7 +120,7 @@ static int disable_events(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } @@ -152,7 +152,7 @@ static int disable_events(char *session_name) #if 0 if (opt_cmd_name != NULL || opt_pid) { MSG("Only supporting tracing all UST processes (-u) for now."); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } #endif diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 2da06ad50..5443d78a3 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -159,7 +159,7 @@ static int enable_channel(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 8360821fb..c5a969f20 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -232,7 +232,7 @@ static int enable_events(char *session_name) dom.type = LTTNG_DOMAIN_UST; } else { ERR("Please specify a tracer (-k/--kernel or -u/--userspace)"); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } @@ -327,14 +327,14 @@ static int enable_events(char *session_name) MSG("per-syscall selection not supported yet. Use \"-a\" " "for all syscalls."); default: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } } else if (opt_userspace) { /* User-space tracer action */ #if 0 if (opt_cmd_name != NULL || opt_pid) { MSG("Only supporting tracing all UST processes (-u) for now."); - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } #endif @@ -362,7 +362,7 @@ static int enable_events(char *session_name) case LTTNG_EVENT_FUNCTION_ENTRY: case LTTNG_EVENT_SYSCALL: default: - ret = CMD_NOT_IMPLEMENTED; + ret = CMD_UNDEFINED; goto error; } } else { diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 7058dd529..031b015ef 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -263,9 +263,6 @@ static int handle_command(int argc, char **argv) case CMD_ERROR: ERR("Command error"); break; - case CMD_NOT_IMPLEMENTED: - ERR("Options not implemented"); - break; case CMD_UNDEFINED: ERR("Undefined command"); break; -- 2.34.1