X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=lttng-sessiond%2Fmain.c;h=40ad9add84747538fe860662f95e5bf19f5a9a18;hb=1f3580c7152869e3827f475a713a9567f8357bc8;hp=ea3853c1a6f19b5a0132e86f287e82b3d313073a;hpb=322585731ced1adba36cddcb8bdd5d997d1b2e3e;p=lttng-tools.git diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index ea3853c1a..40ad9add8 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -711,6 +711,19 @@ error: return ret; } +/* + * For each tracing session, update newly registered apps. + */ +static void update_ust_app(int app_sock) +{ + struct ltt_session *sess, *stmp; + + /* For all tracing session(s) */ + cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) { + ust_app_global_update(sess->ust_session, app_sock); + } +} + /* * This thread manage event coming from the kernel. * @@ -1062,6 +1075,12 @@ static void *thread_manage_apps(void *data) DBG("Apps with sock %d added to poll set", ust_cmd.sock); } + + /* + * Add channel(s) and event(s) to newly registered apps + * from lttng global UST domain. + */ + update_ust_app(ust_cmd.sock); break; } } else { @@ -1699,6 +1718,7 @@ static int create_ust_session(struct ltt_session *session, /* No ustctl for the global UST domain */ break; default: + ERR("Unknown UST domain on create session %d", domain->type); goto error; } session->ust_session = lus; @@ -2228,6 +2248,10 @@ static int cmd_enable_event(struct ltt_session *session, int domain, ret = LTTCOMM_UST_ENABLE_FAIL; goto error; } + + rcu_read_lock(); + hashtable_add_unique(uchan->events, &uevent->node); + rcu_read_unlock(); break; } case LTTNG_DOMAIN_UST_EXEC_NAME: @@ -2410,6 +2434,9 @@ static int cmd_start_trace(struct ltt_session *session) kernel_wait_quiescent(kernel_tracer_fd); } + /* Flag session that trace should start automatically */ + usess->start_trace = 1; + ret = ust_app_start_trace(usess); if (ret < 0) { ret = LTTCOMM_UST_START_FAIL;