Change JUL agent to use the new ABI
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
Appliedmerged, thanks!
Mathieu
----- Original Message -----
Quoted 57 lines
From: "David Goulet" <[email protected]>
To: [email protected]
Cc: "mathieu desnoyers" <[email protected]>, "David Goulet" <[email protected]>
Sent: Friday, August 8, 2014 12:48:48 PM
Subject: [PATCH lttng-ust] Change JUL agent to use the new ABIFrom: David Goulet <[email protected]>
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 <[email protected]>--- .../org/lttng/ust/jul/LTTngTCPSessiondClient.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)liblttng-ust-jul/org/lttng/ust/jul/LTTngTCPSessiondClient.java +9
-4@@ -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(); --2.1.0.rc1
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com