// ------------------------------------------------------------------------
/**
- * Constructor to create a new LTTng tracing session, which will use the
- * command-line "lttng" utility.
+ * Create a new LTTng tracing session using the default backend.
*
* @param sessionName
* The name of the session to use. It can be null, in which case
* The tracing domain of this session
* @return The new session object
*/
- static ILttngSession newCommandLineSession(String sessionName, Domain domain) {
+ static ILttngSession createSession(String sessionName, Domain domain) {
+ return createCommandLineSession(sessionName, domain);
+ }
+
+ /**
+ * Create a new LTTng tracing session, which will use the command-line
+ * "lttng" utility.
+ *
+ * @param sessionName
+ * The name of the session to use. It can be null, in which case
+ * we will provide a unique random name.
+ * @param domain
+ * The tracing domain of this session
+ * @return The new session object
+ */
+ static ILttngSession createCommandLineSession(String sessionName, Domain domain) {
return new LttngCommandLineSession(sessionName, domain);
}
* was an error
*/
public static boolean checkForLttngTools(Domain domain) {
- try (ILttngSession session = ILttngSession.newCommandLineSession(null, domain)) {
+ try (ILttngSession session = ILttngSession.createSession(null, domain)) {
boolean ret1 = session.enableAllEvents();
boolean ret2 = session.start();
boolean ret3 = session.stop();
public void testSetup() throws IOException {
handler = new LttngLogHandler();
- session = ILttngSession.newCommandLineSession(null, Domain.JUL);
+ session = ILttngSession.createSession(null, Domain.JUL);
assertTrue(session.enableEvents("non-event"));
assertTrue(session.start());
}
public void testSetup() throws IOException {
handler = new LttngLogHandler();
- session = ILttngSession.newCommandLineSession(null, Domain.JUL);
+ session = ILttngSession.createSession(null, Domain.JUL);
assertTrue(session.enableAllEvents());
assertTrue(session.start());
}
public void testSetup() {
LTTngAgent.getLTTngAgent();
- session = ILttngSession.newCommandLineSession(null, Domain.JUL);
+ session = ILttngSession.createSession(null, Domain.JUL);
assertTrue(session.enableEvents("non-event"));
assertTrue(session.start());
}
fail();
}
- session = ILttngSession.newCommandLineSession(null, Domain.JUL);
+ session = ILttngSession.createSession(null, Domain.JUL);
assertTrue(session.enableAllEvents());
assertTrue(session.start());
}
*/
@Before
public void testSetup() {
- session = ILttngSession.newCommandLineSession(null, getDomain());
+ session = ILttngSession.createSession(null, getDomain());
}
/**
*/
@Before
public void testSetup() {
- session1 = ILttngSession.newCommandLineSession(null, getDomain());
- session2 = ILttngSession.newCommandLineSession(null, getDomain());
- session3 = ILttngSession.newCommandLineSession(null, getDomain());
+ session1 = ILttngSession.createSession(null, getDomain());
+ session2 = ILttngSession.createSession(null, getDomain());
+ session3 = ILttngSession.createSession(null, getDomain());
}
/**
loggerA.setLevel(Level.ALL);
loggerB.setLevel(Level.ALL);
- session = ILttngSession.newCommandLineSession(null, DOMAIN);
+ session = ILttngSession.createSession(null, DOMAIN);
}
/**
loggerA.setLevel(Level.ALL);
loggerB.setLevel(Level.ALL);
- session = ILttngSession.newCommandLineSession(null, DOMAIN);
+ session = ILttngSession.createSession(null, DOMAIN);
}
/**