Change JUL agent to use the new ABI
authorDavid Goulet <dgoulet@efficios.com>
Fri, 8 Aug 2014 16:48:48 +0000 (12:48 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 8 Aug 2014 17:38:33 +0000 (13:38 -0400)
Two things have changed, the agent port file created by the session
daemon, the name is now "agent.port". The second thing is that upon
registration, the agent needs to send its domain which is here
LTTNG_DOMAIN_JUL (val: 3).

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

index 861c7340a62480087ae83332ad541e7ce9484777..cf3074b0728f21d7d66ef4d046827a913e86feac 100644 (file)
@@ -53,8 +53,13 @@ public class LTTngTCPSessiondClient {
 
        private Semaphore registerSem;
 
-       private static final String rootPortFile = "/var/run/lttng/jul.port";
-       private static final String userPortFile = "/.lttng/jul.port";
+       private static final String rootPortFile = "/var/run/lttng/agent.port";
+       private static final String userPortFile = "/.lttng/agent.port";
+       /*
+        * This is taken from the lttng/domain.h file which is mapped to
+        * LTTNG_DOMAIN_JUL value for this agent.
+        */
+       private static final int agent_domain = 3;
 
        /* Indicate if we've already release the semaphore. */
        private boolean sem_posted = false;
@@ -311,10 +316,11 @@ public class LTTngTCPSessiondClient {
        }
 
        private void registerToSessiond() throws Exception {
-               byte data[] = new byte[4];
+               byte data[] = new byte[8];
                ByteBuffer buf = ByteBuffer.wrap(data);
                String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
 
+               buf.putInt(this.agent_domain);
                buf.putInt(Integer.parseInt(pid));
                this.outToSessiond.write(data, 0, data.length);
                this.outToSessiond.flush();
This page took 0.025552 seconds and 4 git commands to generate.