return ret;
}
-/*
- * For a specific UST session, create the channel for all registered apps.
- */
-int ust_app_create_channel_glb(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan)
-{
- int ret = 0;
- struct cds_lfht_iter iter;
- struct ust_app *app;
-
- assert(usess);
- assert(usess->active);
- assert(uchan);
-
- DBG2("UST app adding channel %s to UST domain for session id %" PRIu64,
- uchan->name, usess->id);
-
- rcu_read_lock();
- /* For every registered applications */
- cds_lfht_for_each_entry(ust_app_ht->ht, &iter, app, pid_n.node) {
- struct ust_app_session *ua_sess;
- int session_was_created = 0;
- bool present_in_tracker =
- trace_ust_id_tracker_lookup(LTTNG_TRACKER_VPID,
- usess, app->pid) &&
- trace_ust_id_tracker_lookup(LTTNG_TRACKER_VUID,
- usess, app->uid) &&
- trace_ust_id_tracker_lookup(LTTNG_TRACKER_VGID,
- usess, app->gid);
-
- if (!app->compatible || !(present_in_tracker)) {
- /*
- * This is probably an error this MUST BE TESTED
- * Introduced by
- * 88e3c2f5610b9ac89b0923d448fee34140fc46fb On app not
- * in tracker we should skip it. not sure what to do on
- * app !compatible
- */
- goto error_rcu_unlock;
- }
-
- /*
- * Create session on the tracer side and add it to app session HT. Note
- * that if session exist, it will simply return a pointer to the ust
- * app session.
- */
- ret = find_or_create_ust_app_session(usess, app, &ua_sess,
- &session_was_created);
- if (ret < 0) {
- switch (ret) {
- case -ENOTCONN:
- /*
- * The application's socket is not valid. Either a bad
- * socket or a timeout on it. We can't inform the caller
- * that for a specific app, the session failed so lets
- * continue here; it is not an error.
- */
- ret = 0;
- goto error_rcu_unlock;
- case -ENOMEM:
- default:
- goto error_rcu_unlock;
- }
- }
-
- if (ua_sess->deleted) {
- continue;
- }
- ret = ust_app_channel_create(usess, ua_sess, uchan, app, NULL);
- if (ret) {
- if (session_was_created) {
- destroy_app_session(app, ua_sess);
- }
- /* Continue to the next application. */
- }
- }
-
-error_rcu_unlock:
- rcu_read_unlock();
- return ret;
-}
-
/*
* Enable event for a specific session and channel on the tracer.
*/
int ust_app_destroy_trace_all(struct ltt_ust_session *usess);
int ust_app_list_events(struct lttng_event **events);
int ust_app_list_event_fields(struct lttng_event_field **fields);
-int ust_app_create_channel_glb(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan);
int ust_app_create_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent);
int ust_app_disable_channel_glb(struct ltt_ust_session *usess,
return 0;
}
static inline
-int ust_app_create_channel_glb(struct ltt_ust_session *usess,
- struct ltt_ust_channel *uchan)
-{
- return 0;
-}
-static inline
int ust_app_create_event_glb(struct ltt_ust_session *usess,
struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent)
{