Auto creation of chan/event on apps registration
[lttng-tools.git] / lttng-sessiond / main.c
index ea3853c1a6f19b5a0132e86f287e82b3d313073a..f13571ab37159fc00d9aac331444eab9cb68db42 100644 (file)
@@ -711,6 +711,19 @@ error:
        return ret;
 }
 
        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.
  *
 /*
  * 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);
                                        }
                                                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 {
                                        break;
                                }
                        } else {
@@ -2228,6 +2247,10 @@ static int cmd_enable_event(struct ltt_session *session, int domain,
                        ret = LTTCOMM_UST_ENABLE_FAIL;
                        goto error;
                }
                        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:
                break;
        }
        case LTTNG_DOMAIN_UST_EXEC_NAME:
This page took 0.023634 seconds and 4 git commands to generate.