}
/*
- * The caller must ensure that the application is compatible and is tracked
- * by the process attribute trackers.
+ * RCU read lock must be held by the caller.
*/
static
-void ust_app_synchronize(struct ltt_ust_session *usess,
+void ust_app_synchronize_all_channels(struct ltt_ust_session *usess,
+ struct ust_app_session *ua_sess,
struct ust_app *app)
{
int ret = 0;
struct cds_lfht_iter uchan_iter;
struct ltt_ust_channel *uchan;
- struct ust_app_session *ua_sess = NULL;
- /*
- * The application's configuration should only be synchronized for
- * active sessions.
- */
- assert(usess->active);
-
- ret = find_or_create_ust_app_session(usess, app, &ua_sess, NULL);
- if (ret < 0) {
- /* Tracer is probably gone or ENOMEM. */
- goto error;
- }
+ assert(usess);
assert(ua_sess);
-
- pthread_mutex_lock(&ua_sess->lock);
- if (ua_sess->deleted) {
- pthread_mutex_unlock(&ua_sess->lock);
- goto end;
- }
-
- rcu_read_lock();
+ assert(app);
cds_lfht_for_each_entry(usess->domain_global.channels->ht, &uchan_iter,
uchan, node.node) {
app, uchan, &ua_chan);
if (ret) {
/* Tracer is probably gone or ENOMEM. */
- goto error_unlock;
+ goto end;
}
if (!ua_chan) {
ret = ust_app_channel_synchronize_event(ua_chan,
uevent, ua_sess, app);
if (ret) {
- goto error_unlock;
+ goto end;
}
}
enable_ust_app_channel(ua_sess, uchan, app) :
disable_ust_app_channel(ua_sess, ua_chan, app);
if (ret) {
- goto error_unlock;
+ goto end;
}
}
}
+end:
+ return;
+}
+
+/*
+ * The caller must ensure that the application is compatible and is tracked
+ * by the process attribute trackers.
+ */
+static
+void ust_app_synchronize(struct ltt_ust_session *usess,
+ struct ust_app *app)
+{
+ int ret = 0;
+ struct ust_app_session *ua_sess = NULL;
+
+ /*
+ * The application's configuration should only be synchronized for
+ * active sessions.
+ */
+ assert(usess->active);
+
+ ret = find_or_create_ust_app_session(usess, app, &ua_sess, NULL);
+ if (ret < 0) {
+ /* Tracer is probably gone or ENOMEM. */
+ goto error;
+ }
+ assert(ua_sess);
+
+ pthread_mutex_lock(&ua_sess->lock);
+ if (ua_sess->deleted) {
+ pthread_mutex_unlock(&ua_sess->lock);
+ goto end;
+ }
+
+ rcu_read_lock();
+
+ ust_app_synchronize_all_channels(usess, ua_sess, app);
/*
* Create the metadata for the application. This returns gracefully if a