Remove jul attach/detach, not needed for now
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Nov 2013 15:42:26 +0000 (10:42 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Nov 2013 15:46:45 +0000 (10:46 -0500)
Not needed, and corner cases not covered.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng-sessiond/jul-thread.c
src/bin/lttng-sessiond/jul.c
src/bin/lttng-sessiond/jul.h

index 972186059dd3f08fa7ab5350fb804936ee16bb12..c1df1d86282485c4166d17fa7191eaa14b1e2343 100644 (file)
@@ -223,13 +223,10 @@ static int handle_registration(struct lttcomm_sock *reg_sock)
        jul_add_app(app);
 
        /*
-        * Attach JUL application to a UST app object if one exists.
-        *
-        * FIXME: This implies that the UST app object exists and created before
-        * JUL registration. Must confirm or else JUL app will leak until socket is
-        * closed by the application.
+        * We don't need to attach the JUL app to the app. If we ever do
+        * so, we should consider both registration order of JUL before
+        * app and app before JUL.
         */
-       jul_attach_app(app);
 
        return new_sock->fd;
 
@@ -317,10 +314,6 @@ restart:
                                        goto error;
                                }
 
-                               /*
-                                * FIXME: Should we try to invalidate the JUL socket in the
-                                * associated ust app.
-                                */
                                destroy_jul_app(pollfd);
                        } else if (revents & (LPOLLIN)) {
                                int new_fd;
index c4d81217a4ded46ebe712620782dd616fdc63d67..183081dc04bc942df9363eabc2d70f2e03d4517c 100644 (file)
@@ -494,8 +494,6 @@ struct jul_app *jul_create_app(pid_t pid, struct lttcomm_sock *sock)
 
        app->pid = pid;
        app->sock = sock;
-       /* Flag it invalid until assignation. */
-       app->ust_app_sock = -1;
        lttng_ht_node_init_ulong(&app->node, (unsigned long) app->sock->fd);
 
 error:
@@ -546,59 +544,6 @@ void jul_add_app(struct jul_app *app)
        rcu_read_unlock();
 }
 
-/*
- * Attach a given JUL application to an UST app object. This is done by copying
- * the socket fd value into the ust app obj. atomically.
- */
-void jul_attach_app(struct jul_app *japp)
-{
-       struct ust_app *uapp;
-
-       assert(japp);
-
-       rcu_read_lock();
-       uapp = ust_app_find_by_pid(japp->pid);
-       if (!uapp) {
-               goto end;
-       }
-
-       uatomic_set(&uapp->jul_app_sock, japp->sock->fd);
-
-       DBG3("JUL app pid: %d, sock: %d attached to UST app.", japp->pid,
-                       japp->sock->fd);
-
-end:
-       rcu_read_unlock();
-       return;
-}
-
-/*
- * Remove JUL app. reference from an UST app object and set it to NULL.
- */
-void jul_detach_app(struct jul_app *japp)
-{
-       struct ust_app *uapp;
-
-       assert(japp);
-
-       rcu_read_lock();
-
-       if (japp->ust_app_sock < 0) {
-               goto end;
-       }
-
-       uapp = ust_app_find_by_sock(japp->ust_app_sock);
-       if (!uapp) {
-               goto end;
-       }
-
-       uapp->jul_app_sock = -1;
-
-end:
-       rcu_read_unlock();
-       return;
-}
-
 /*
  * Delete JUL application from the global hash table.
  */
index 72ca91c72bc52699aa4d413fac7cb7faad88087a..92da2012e13f02d9d809e9593ff846730327ce88 100644 (file)
@@ -54,14 +54,6 @@ struct jul_app {
         */
        struct lttcomm_sock *sock;
 
-       /*
-        * Associated UST app. socket. To get a reference to the ust application
-        * object corresponding to that socket, a lookup MUST be done each time
-        * since there is important synchronization issue for the lockless hash
-        * table shared accross multiple threads.
-        */
-       int ust_app_sock;
-
        /* Initialized with the JUL sock value. */
        struct lttng_ht_node_ulong node;
 };
@@ -124,8 +116,6 @@ struct jul_app *jul_create_app(pid_t pid, struct lttcomm_sock *sock);
 void jul_add_app(struct jul_app *app);
 void jul_delete_app(struct jul_app *app);
 struct jul_app *jul_find_app_by_sock(int sock);
-void jul_attach_app(struct jul_app *japp);
-void jul_detach_app(struct jul_app *app);
 void jul_destroy_app(struct jul_app *app);
 
 /* JUL action API */
This page took 0.028935 seconds and 5 git commands to generate.