projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: consumer health state
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
channel.c
diff --git
a/src/bin/lttng-sessiond/channel.c
b/src/bin/lttng-sessiond/channel.c
index 57c5c422507b26bc34a74301757ec66ab37963dd..dfc7892674bbe1f15dc74d818175ea3c60c3c65d 100644
(file)
--- a/
src/bin/lttng-sessiond/channel.c
+++ b/
src/bin/lttng-sessiond/channel.c
@@
-91,17
+91,17
@@
int channel_kernel_disable(struct ltt_kernel_session *ksession,
kchan = trace_kernel_get_channel_by_name(channel_name, ksession);
if (kchan == NULL) {
kchan = trace_kernel_get_channel_by_name(channel_name, ksession);
if (kchan == NULL) {
- ret = LTT
COMM
_KERN_CHAN_NOT_FOUND;
+ ret = LTT
NG_ERR
_KERN_CHAN_NOT_FOUND;
goto error;
} else if (kchan->enabled == 1) {
ret = kernel_disable_channel(kchan);
if (ret < 0 && ret != -EEXIST) {
goto error;
} else if (kchan->enabled == 1) {
ret = kernel_disable_channel(kchan);
if (ret < 0 && ret != -EEXIST) {
- ret = LTT
COMM
_KERN_CHAN_DISABLE_FAIL;
+ ret = LTT
NG_ERR
_KERN_CHAN_DISABLE_FAIL;
goto error;
}
}
goto error;
}
}
- ret = LTT
COMM
_OK;
+ ret = LTT
NG
_OK;
error:
return ret;
error:
return ret;
@@
-118,12
+118,15
@@
int channel_kernel_enable(struct ltt_kernel_session *ksession,
if (kchan->enabled == 0) {
ret = kernel_enable_channel(kchan);
if (ret < 0) {
if (kchan->enabled == 0) {
ret = kernel_enable_channel(kchan);
if (ret < 0) {
- ret = LTT
COMM
_KERN_CHAN_ENABLE_FAIL;
+ ret = LTT
NG_ERR
_KERN_CHAN_ENABLE_FAIL;
goto error;
}
goto error;
}
+ } else {
+ ret = LTTNG_ERR_KERN_CHAN_EXIST;
+ goto error;
}
}
- ret = LTT
COMM
_OK;
+ ret = LTT
NG
_OK;
error:
return ret;
error:
return ret;
@@
-142,7
+145,7
@@
int channel_kernel_create(struct ltt_kernel_session *ksession,
if (attr == NULL) {
defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
if (defattr == NULL) {
if (attr == NULL) {
defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
if (defattr == NULL) {
- ret = LTT
COMM
_FATAL;
+ ret = LTT
NG_ERR
_FATAL;
goto error;
}
attr = defattr;
goto error;
}
attr = defattr;
@@
-151,18
+154,18
@@
int channel_kernel_create(struct ltt_kernel_session *ksession,
/* Channel not found, creating it */
ret = kernel_create_channel(ksession, attr, ksession->trace_path);
if (ret < 0) {
/* Channel not found, creating it */
ret = kernel_create_channel(ksession, attr, ksession->trace_path);
if (ret < 0) {
- ret = LTT
COMM
_KERN_CHAN_FAIL;
+ ret = LTT
NG_ERR
_KERN_CHAN_FAIL;
goto error;
}
/* Notify kernel thread that there is a new channel */
ret = notify_thread_pipe(kernel_pipe);
if (ret < 0) {
goto error;
}
/* Notify kernel thread that there is a new channel */
ret = notify_thread_pipe(kernel_pipe);
if (ret < 0) {
- ret = LTT
COMM
_FATAL;
+ ret = LTT
NG_ERR
_FATAL;
goto error;
}
goto error;
}
- ret = LTT
COMM
_OK;
+ ret = LTT
NG
_OK;
error:
free(defattr);
return ret;
error:
free(defattr);
return ret;
@@
-174,11
+177,12
@@
error:
int channel_ust_enable(struct ltt_ust_session *usess, int domain,
struct ltt_ust_channel *uchan)
{
int channel_ust_enable(struct ltt_ust_session *usess, int domain,
struct ltt_ust_channel *uchan)
{
- int ret = LTT
COMM
_OK;
+ int ret = LTT
NG
_OK;
/* If already enabled, everything is OK */
if (uchan->enabled) {
DBG3("Channel %s already enabled. Skipping", uchan->name);
/* If already enabled, everything is OK */
if (uchan->enabled) {
DBG3("Channel %s already enabled. Skipping", uchan->name);
+ ret = LTTNG_ERR_UST_CHAN_EXIST;
goto end;
}
goto end;
}
@@
-194,16
+198,16
@@
int channel_ust_enable(struct ltt_ust_session *usess, int domain,
case LTTNG_DOMAIN_UST_EXEC_NAME:
#endif
default:
case LTTNG_DOMAIN_UST_EXEC_NAME:
#endif
default:
- ret = LTT
COMM
_UND;
+ ret = LTT
NG_ERR
_UND;
goto error;
}
if (ret < 0) {
if (ret != -EEXIST) {
goto error;
}
if (ret < 0) {
if (ret != -EEXIST) {
- ret = LTT
COMM
_UST_CHAN_ENABLE_FAIL;
+ ret = LTT
NG_ERR
_UST_CHAN_ENABLE_FAIL;
goto error;
} else {
goto error;
} else {
- ret = LTT
COMM
_OK;
+ ret = LTT
NG
_OK;
}
}
}
}
@@
-221,7
+225,7
@@
error:
int channel_ust_create(struct ltt_ust_session *usess, int domain,
struct lttng_channel *attr)
{
int channel_ust_create(struct ltt_ust_session *usess, int domain,
struct lttng_channel *attr)
{
- int ret = LTT
COMM
_OK;
+ int ret = LTT
NG
_OK;
struct ltt_ust_channel *uchan = NULL;
struct lttng_channel *defattr = NULL;
struct ltt_ust_channel *uchan = NULL;
struct lttng_channel *defattr = NULL;
@@
-229,7
+233,7
@@
int channel_ust_create(struct ltt_ust_session *usess, int domain,
if (attr == NULL) {
defattr = channel_new_default_attr(domain);
if (defattr == NULL) {
if (attr == NULL) {
defattr = channel_new_default_attr(domain);
if (defattr == NULL) {
- ret = LTT
COMM
_FATAL;
+ ret = LTT
NG_ERR
_FATAL;
goto error;
}
attr = defattr;
goto error;
}
attr = defattr;
@@
-242,18
+246,18
@@
int channel_ust_create(struct ltt_ust_session *usess, int domain,
* (unlike kernel tracing).
*/
if (!attr->attr.subbuf_size || (attr->attr.subbuf_size & (attr->attr.subbuf_size - 1))) {
* (unlike kernel tracing).
*/
if (!attr->attr.subbuf_size || (attr->attr.subbuf_size & (attr->attr.subbuf_size - 1))) {
- ret = LTT
COMM
_INVALID;
+ ret = LTT
NG_ERR
_INVALID;
goto error;
}
if (!attr->attr.num_subbuf || (attr->attr.num_subbuf & (attr->attr.num_subbuf - 1))) {
goto error;
}
if (!attr->attr.num_subbuf || (attr->attr.num_subbuf & (attr->attr.num_subbuf - 1))) {
- ret = LTT
COMM
_INVALID;
+ ret = LTT
NG_ERR
_INVALID;
goto error;
}
/* Create UST channel */
uchan = trace_ust_create_channel(attr, usess->pathname);
if (uchan == NULL) {
goto error;
}
/* Create UST channel */
uchan = trace_ust_create_channel(attr, usess->pathname);
if (uchan == NULL) {
- ret = LTT
COMM
_FATAL;
+ ret = LTT
NG_ERR
_FATAL;
goto error;
}
uchan->enabled = 1;
goto error;
}
uchan->enabled = 1;
@@
-271,12
+275,12
@@
int channel_ust_create(struct ltt_ust_session *usess, int domain,
case LTTNG_DOMAIN_UST_EXEC_NAME:
#endif
default:
case LTTNG_DOMAIN_UST_EXEC_NAME:
#endif
default:
- ret = LTT
COMM
_UND;
+ ret = LTT
NG_ERR
_UND;
goto error_free_chan;
}
if (ret < 0 && ret != -EEXIST) {
goto error_free_chan;
}
if (ret < 0 && ret != -EEXIST) {
- ret = LTT
COMM_UST_CHAN_ENABLE
_FAIL;
+ ret = LTT
NG_ERR_UST_CHAN
_FAIL;
goto error_free_chan;
}
goto error_free_chan;
}
@@
-288,7
+292,7
@@
int channel_ust_create(struct ltt_ust_session *usess, int domain,
DBG2("Channel %s created successfully", uchan->name);
free(defattr);
DBG2("Channel %s created successfully", uchan->name);
free(defattr);
- return LTT
COMM
_OK;
+ return LTT
NG
_OK;
error_free_chan:
/*
error_free_chan:
/*
@@
-307,7
+311,7
@@
error:
int channel_ust_disable(struct ltt_ust_session *usess, int domain,
struct ltt_ust_channel *uchan)
{
int channel_ust_disable(struct ltt_ust_session *usess, int domain,
struct ltt_ust_channel *uchan)
{
- int ret = LTT
COMM
_OK;
+ int ret = LTT
NG
_OK;
/* Already disabled */
if (uchan->enabled == 0) {
/* Already disabled */
if (uchan->enabled == 0) {
@@
-328,12
+332,12
@@
int channel_ust_disable(struct ltt_ust_session *usess, int domain,
case LTTNG_DOMAIN_UST_PID:
#endif
default:
case LTTNG_DOMAIN_UST_PID:
#endif
default:
- ret = LTT
COMM
_UND;
+ ret = LTT
NG_ERR
_UND;
goto error;
}
if (ret < 0 && ret != -EEXIST) {
goto error;
}
if (ret < 0 && ret != -EEXIST) {
- ret = LTT
COMM_UST
_DISABLE_FAIL;
+ ret = LTT
NG_ERR_UST_CHAN
_DISABLE_FAIL;
goto error;
}
goto error;
}
@@
-341,7
+345,7
@@
int channel_ust_disable(struct ltt_ust_session *usess, int domain,
DBG2("Channel %s disabled successfully", uchan->name);
DBG2("Channel %s disabled successfully", uchan->name);
- return LTT
COMM
_OK;
+ return LTT
NG
_OK;
end:
error:
end:
error:
This page took
0.030088 seconds
and
5
git commands to generate.