From: David Goulet Date: Wed, 26 Feb 2014 21:06:31 +0000 (-0500) Subject: Fix: handle registration done command X-Git-Tag: v2.4.0~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f08bb871203e921da1b0cdce6f9ff88d32a2fb4e;p=lttng-ust.git Fix: handle registration done command 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-jul/org/lttng/ust/jul/LTTngSessiondCmd2_4.java b/liblttng-ust-jul/org/lttng/ust/jul/LTTngSessiondCmd2_4.java index 7f5f61d1..4cb5a731 100644 --- a/liblttng-ust-jul/org/lttng/ust/jul/LTTngSessiondCmd2_4.java +++ b/liblttng-ust-jul/org/lttng/ust/jul/LTTngSessiondCmd2_4.java @@ -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) { diff --git a/liblttng-ust-jul/org/lttng/ust/jul/LTTngTCPSessiondClient.java b/liblttng-ust-jul/org/lttng/ust/jul/LTTngTCPSessiondClient.java index 35f768f3..aab1d054 100644 --- a/liblttng-ust-jul/org/lttng/ust/jul/LTTngTCPSessiondClient.java +++ b/liblttng-ust-jul/org/lttng/ust/jul/LTTngTCPSessiondClient.java @@ -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 =