projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve error handling of lttng cli
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
enable_channels.c
diff --git
a/src/bin/lttng/commands/enable_channels.c
b/src/bin/lttng/commands/enable_channels.c
index 19b6b260bd7065e0b6490d8e247036483ecb14c6..942dbf00e028e53a09f63d9a622d38f52cb636b8 100644
(file)
--- a/
src/bin/lttng/commands/enable_channels.c
+++ b/
src/bin/lttng/commands/enable_channels.c
@@
-151,7
+151,7
@@
static void set_default_attr(struct lttng_domain *dom)
*/
static int enable_channel(char *session_name)
{
*/
static int enable_channel(char *session_name)
{
- int ret = CMD_SUCCESS;
+ int ret = CMD_SUCCESS
, warn = 0
;
char *channel_name;
struct lttng_domain dom;
char *channel_name;
struct lttng_domain dom;
@@
-185,7
+185,9
@@
static int enable_channel(char *session_name)
ret = lttng_enable_channel(handle, &chan);
if (ret < 0) {
ret = lttng_enable_channel(handle, &chan);
if (ret < 0) {
- goto error;
+ ERR("Channel %s: %s (session %s)", channel_name,
+ lttng_strerror(ret), session_name);
+ warn = 1;
} else {
MSG("%s channel %s enabled for session %s",
opt_kernel ? "Kernel" : "UST", channel_name,
} else {
MSG("%s channel %s enabled for session %s",
opt_kernel ? "Kernel" : "UST", channel_name,
@@
-196,7
+198,13
@@
static int enable_channel(char *session_name)
channel_name = strtok(NULL, ",");
}
channel_name = strtok(NULL, ",");
}
+ ret = CMD_SUCCESS;
+
error:
error:
+ if (warn) {
+ ret = CMD_WARNING;
+ }
+
lttng_destroy_handle(handle);
return ret;
lttng_destroy_handle(handle);
return ret;
This page took
0.026545 seconds
and
5
git commands to generate.