projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: send_channel_monitor_pipe does not take the consumer socket lock
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
ust-app.c
diff --git
a/src/bin/lttng-sessiond/ust-app.c
b/src/bin/lttng-sessiond/ust-app.c
index e79455b01fb055588c7473a913f583ae9e567ad3..60ff1be03b194eee686aa391e73615039988b3ab 100644
(file)
--- a/
src/bin/lttng-sessiond/ust-app.c
+++ b/
src/bin/lttng-sessiond/ust-app.c
@@
-2845,6
+2845,8
@@
error:
/*
* Create and send to the application the created buffers with per UID buffers.
*
/*
* Create and send to the application the created buffers with per UID buffers.
*
+ * This MUST be called with a RCU read side lock acquired.
+ *
* Return 0 on success else a negative value.
*/
static int create_channel_per_uid(struct ust_app *app,
* Return 0 on success else a negative value.
*/
static int create_channel_per_uid(struct ust_app *app,
@@
-2917,22
+2919,12
@@
static int create_channel_per_uid(struct ust_app *app,
created = true;
}
created = true;
}
- /* Send buffers to the application. */
- ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan);
- if (ret < 0) {
- if (ret != -ENOTCONN) {
- ERR("Error sending channel to application");
- }
- goto error;
- }
-
if (created) {
enum lttng_error_code cmd_ret;
struct ltt_session *session;
uint64_t chan_reg_key;
struct ust_registry_channel *chan_reg;
if (created) {
enum lttng_error_code cmd_ret;
struct ltt_session *session;
uint64_t chan_reg_key;
struct ust_registry_channel *chan_reg;
- rcu_read_lock();
chan_reg_key = ua_chan->tracing_channel_id;
pthread_mutex_lock(®_uid->registry->reg.ust->lock);
chan_reg_key = ua_chan->tracing_channel_id;
pthread_mutex_lock(®_uid->registry->reg.ust->lock);
@@
-2953,7
+2945,6
@@
static int create_channel_per_uid(struct ust_app *app,
ua_chan->key,
LTTNG_DOMAIN_UST,
ua_chan->attr.subbuf_size * ua_chan->attr.num_subbuf);
ua_chan->key,
LTTNG_DOMAIN_UST,
ua_chan->attr.subbuf_size * ua_chan->attr.num_subbuf);
- rcu_read_unlock();
if (cmd_ret != LTTNG_OK) {
ret = - (int) cmd_ret;
ERR("Failed to add channel to notification thread");
if (cmd_ret != LTTNG_OK) {
ret = - (int) cmd_ret;
ERR("Failed to add channel to notification thread");
@@
-2961,6
+2952,15
@@
static int create_channel_per_uid(struct ust_app *app,
}
}
}
}
+ /* Send buffers to the application. */
+ ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan);
+ if (ret < 0) {
+ if (ret != -ENOTCONN) {
+ ERR("Error sending channel to application");
+ }
+ goto error;
+ }
+
error:
return ret;
}
error:
return ret;
}
@@
-3577,8
+3577,8
@@
void ust_app_unregister(int sock)
/*
* Remove application from notify hash table. The thread handling the
* notify socket could have deleted the node so ignore on error because
/*
* Remove application from notify hash table. The thread handling the
* notify socket could have deleted the node so ignore on error because
- * either way it's valid. The close of that socket is handled by the
other
- * thread.
+ * either way it's valid. The close of that socket is handled by the
+ *
apps_notify_
thread.
*/
iter.iter.node = <a->notify_sock_n.node;
(void) lttng_ht_del(ust_app_ht_by_notify_sock, &iter);
*/
iter.iter.node = <a->notify_sock_n.node;
(void) lttng_ht_del(ust_app_ht_by_notify_sock, &iter);
This page took
0.032581 seconds
and
4
git commands to generate.