projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: check ht_del ret value of ust app session
[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 4ec12302b027e83ea3f63b5da862ce04737ecab0..d07e1d901fa3ba10170cb259411c105689a6a4a4 100644
(file)
--- a/
src/bin/lttng-sessiond/channel.c
+++ b/
src/bin/lttng-sessiond/channel.c
@@
-54,7
+54,8
@@
struct lttng_channel *channel_new_default_attr(int dom)
switch (dom) {
case LTTNG_DOMAIN_KERNEL:
switch (dom) {
case LTTNG_DOMAIN_KERNEL:
- chan->attr.subbuf_size = DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE;
+ chan->attr.subbuf_size =
+ default_get_kernel_channel_subbuf_size();
chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
break;
chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
break;
@@
-64,7
+65,7
@@
struct lttng_channel *channel_new_default_attr(int dom)
case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
case LTTNG_DOMAIN_UST_EXEC_NAME:
#endif
case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
case LTTNG_DOMAIN_UST_EXEC_NAME:
#endif
- chan->attr.subbuf_size =
DEFAULT_UST_CHANNEL_SUBBUF_SIZE
;
+ chan->attr.subbuf_size =
default_get_ust_channel_subbuf_size()
;
chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
break;
chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
break;
@@
-91,17
+92,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,15
+119,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;
}
} else {
goto error;
}
} else {
- ret = LTT
COMM
_KERN_CHAN_EXIST;
+ ret = LTT
NG_ERR
_KERN_CHAN_EXIST;
goto error;
}
goto error;
}
- ret = LTT
COMM
_OK;
+ ret = LTT
NG
_OK;
error:
return ret;
error:
return ret;
@@
-145,7
+146,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;
@@
-154,18
+155,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;
@@
-177,12
+178,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 = LTT
COMM
_UST_CHAN_EXIST;
+ ret = LTT
NG_ERR
_UST_CHAN_EXIST;
goto end;
}
goto end;
}
@@
-198,16
+199,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) {
goto error;
}
if (ret < 0) {
- if (ret != -
E
EXIST) {
- ret = LTT
COMM
_UST_CHAN_ENABLE_FAIL;
+ if (ret != -
LTTNG_UST_ERR_
EXIST) {
+ ret = LTT
NG_ERR
_UST_CHAN_ENABLE_FAIL;
goto error;
} else {
goto error;
} else {
- ret = LTT
COMM
_OK;
+ ret = LTT
NG
_OK;
}
}
}
}
@@
-225,7
+226,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;
@@
-233,7
+234,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;
@@
-246,18
+247,23
@@
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 = LTTCOMM_INVALID;
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
+
+ if (attr->attr.output != LTTNG_EVENT_MMAP) {
+ ret = LTTNG_ERR_NOT_SUPPORTED;
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;
@@
-275,12
+281,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;
}
goto error_free_chan;
}
- if (ret < 0 && ret != -
E
EXIST) {
- ret = LTT
COMM_UST_CHAN_ENABLE
_FAIL;
+ if (ret < 0 && ret != -
LTTNG_UST_ERR_
EXIST) {
+ ret = LTT
NG_ERR_UST_CHAN
_FAIL;
goto error_free_chan;
}
goto error_free_chan;
}
@@
-292,7
+298,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:
/*
@@
-311,7
+317,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) {
@@
-332,12
+338,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;
}
goto error;
}
- if (ret < 0 && ret != -
E
EXIST) {
- ret = LTT
COMM_UST
_DISABLE_FAIL;
+ if (ret < 0 && ret != -
LTTNG_UST_ERR_
EXIST) {
+ ret = LTT
NG_ERR_UST_CHAN
_DISABLE_FAIL;
goto error;
}
goto error;
}
@@
-345,7
+351,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.039533 seconds
and
5
git commands to generate.