projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng-destroy: string formating error when default session is unset
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
channel.cpp
diff --git
a/src/bin/lttng-sessiond/channel.cpp
b/src/bin/lttng-sessiond/channel.cpp
index 96eed11c00c089a69ffd9b79c774b0dcfdba6d98..4e5401295ed43f9d36d87b2e29a78b4f2ca52b72 100644
(file)
--- a/
src/bin/lttng-sessiond/channel.cpp
+++ b/
src/bin/lttng-sessiond/channel.cpp
@@
-145,7
+145,7
@@
int channel_kernel_disable(struct ltt_kernel_session *ksession, char *channel_na
}
/* Only if channel is enabled disable it. */
}
/* Only if channel is enabled disable it. */
- if (kchan->enabled
== 1
) {
+ if (kchan->enabled) {
ret = kernel_disable_channel(kchan);
if (ret < 0 && ret != -EEXIST) {
ret = LTTNG_ERR_KERN_CHAN_DISABLE_FAIL;
ret = kernel_disable_channel(kchan);
if (ret < 0 && ret != -EEXIST) {
ret = LTTNG_ERR_KERN_CHAN_DISABLE_FAIL;
@@
-170,7
+170,7
@@
enum lttng_error_code channel_kernel_enable(struct ltt_kernel_session *ksession,
LTTNG_ASSERT(ksession);
LTTNG_ASSERT(kchan);
LTTNG_ASSERT(ksession);
LTTNG_ASSERT(kchan);
- if (
kchan->enabled == 0
) {
+ if (
!kchan->enabled
) {
if (kernel_enable_channel(kchan) < 0) {
ret_code = LTTNG_ERR_KERN_CHAN_ENABLE_FAIL;
goto error;
if (kernel_enable_channel(kchan) < 0) {
ret_code = LTTNG_ERR_KERN_CHAN_ENABLE_FAIL;
goto error;
@@
-284,7
+284,7
@@
enum lttng_error_code channel_ust_enable(struct ltt_ust_session *usess,
ret_code = LTTNG_ERR_UST_CHAN_EXIST;
goto end;
} else {
ret_code = LTTNG_ERR_UST_CHAN_EXIST;
goto end;
} else {
- uchan->enabled =
1
;
+ uchan->enabled =
true
;
DBG2("Channel %s enabled successfully", uchan->name);
}
DBG2("Channel %s enabled successfully", uchan->name);
}
@@
-325,6
+325,7
@@
enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
struct lttng_channel *defattr = nullptr;
enum lttng_domain_type domain = LTTNG_DOMAIN_UST;
bool chan_published = false;
struct lttng_channel *defattr = nullptr;
enum lttng_domain_type domain = LTTNG_DOMAIN_UST;
bool chan_published = false;
+ lttng::urcu::read_lock_guard read_lock;
LTTNG_ASSERT(usess);
LTTNG_ASSERT(usess);
@@
-425,12
+426,13
@@
enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
goto error;
}
goto error;
}
- uchan->enabled =
1
;
- if (trace_ust_is_max_id(usess->used_
channel
_id)) {
+ uchan->enabled =
true
;
+ if (trace_ust_is_max_id(usess->used_
event_container
_id)) {
ret_code = LTTNG_ERR_UST_CHAN_FAIL;
goto error;
}
ret_code = LTTNG_ERR_UST_CHAN_FAIL;
goto error;
}
- uchan->id = trace_ust_get_next_chan_id(usess);
+
+ uchan->id = trace_ust_get_next_event_container_id(usess);
DBG2("Channel %s is being created for UST with buffer %d and id %" PRIu64,
uchan->name,
DBG2("Channel %s is being created for UST with buffer %d and id %" PRIu64,
uchan->name,
@@
-448,8
+450,7
@@
enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
}
/* Adding the channel to the channel hash table. */
}
/* Adding the channel to the channel hash table. */
- rcu_read_lock();
- if (strncmp(uchan->name, DEFAULT_METADATA_NAME, sizeof(uchan->name))) {
+ if (strncmp(uchan->name, DEFAULT_METADATA_NAME, sizeof(uchan->name)) != 0) {
lttng_ht_add_unique_str(usess->domain_global.channels, &uchan->node);
chan_published = true;
} else {
lttng_ht_add_unique_str(usess->domain_global.channels, &uchan->node);
chan_published = true;
} else {
@@
-460,7
+461,6
@@
enum lttng_error_code channel_ust_create(struct ltt_ust_session *usess,
*/
memcpy(&usess->metadata_attr, &uchan->attr, sizeof(usess->metadata_attr));
}
*/
memcpy(&usess->metadata_attr, &uchan->attr, sizeof(usess->metadata_attr));
}
- rcu_read_unlock();
DBG2("Channel %s created successfully", uchan->name);
if (domain != LTTNG_DOMAIN_UST) {
DBG2("Channel %s created successfully", uchan->name);
if (domain != LTTNG_DOMAIN_UST) {
@@
-501,12
+501,12
@@
int channel_ust_disable(struct ltt_ust_session *usess, struct ltt_ust_channel *u
LTTNG_ASSERT(uchan);
/* Already disabled */
LTTNG_ASSERT(uchan);
/* Already disabled */
- if (
uchan->enabled == 0
) {
+ if (
!uchan->enabled
) {
DBG2("Channel UST %s already disabled", uchan->name);
goto end;
}
DBG2("Channel UST %s already disabled", uchan->name);
goto end;
}
- uchan->enabled =
0
;
+ uchan->enabled =
false
;
/*
* If session is inactive we don't notify the tracer right away. We
/*
* If session is inactive we don't notify the tracer right away. We
This page took
0.025151 seconds
and
4
git commands to generate.