Fix: handle registration done command
authorDavid Goulet <dgoulet@efficios.com>
Wed, 26 Feb 2014 21:06:31 +0000 (16:06 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Feb 2014 21:38:40 +0000 (16:38 -0500)
This makes the getLTTngAgent() call wait until we receive that message
so that in the meantime the session daemon can enable events.

Fixes #692

Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-jul/org/lttng/ust/jul/LTTngSessiondCmd2_4.java
liblttng-ust-jul/org/lttng/ust/jul/LTTngTCPSessiondClient.java

index 7f5f61d1029ecebb6311ed1234ae0e21bb97b0e3..4cb5a7319e99fdad88bdfd684b1c350befdcc33b 100644 (file)
@@ -64,7 +64,10 @@ public interface LTTngSessiondCmd2_4 {
                /** Enable logger by name. */
                CMD_ENABLE(2),
                /** Disable logger by name. */
-               CMD_DISABLE(3);
+               CMD_DISABLE(3),
+               /** Registration done */
+               CMD_REG_DONE(4);
+
                private int code;
 
                private lttng_jul_command(int c) {
index 35f768f30c5b88d27d09cd7a498422cd9a16d222..aab1d05418b2f0d576248aa39950003b399aed58 100644 (file)
@@ -188,7 +188,6 @@ public class LTTngTCPSessiondClient {
                                 * UST application.
                                 */
                                registerToSessiond();
-                               this.registerSem.release();
 
                                setupEventTimer();
 
@@ -274,6 +273,15 @@ public class LTTngTCPSessiondClient {
                        }
 
                        switch (headerCmd.cmd) {
+                               case CMD_REG_DONE:
+                               {
+                                       /*
+                                        * Release semaphore so meaning registration is done and we
+                                        * can proceed to continue tracing.
+                                        */
+                                       this.registerSem.release();
+                                       break;
+                               }
                                case CMD_LIST:
                                {
                                        LTTngSessiondCmd2_4.sessiond_list_logger listLoggerCmd =
This page took 0.025975 seconds and 4 git commands to generate.