Update to session creation procedure
authorBernd Hufmann <bhufmann@gmail.com>
Mon, 25 Feb 2013 13:40:47 +0000 (08:40 -0500)
committerBernd Hufmann <bhufmann@gmail.com>
Mon, 25 Feb 2013 20:47:17 +0000 (15:47 -0500)
- Removed --no-consumer and --disable-consumer option because these
options will be obsolete in LTTng Tools 2.2
- Updated commands and dialog boxes for this change
- Updated JUnit tests

Change-Id: Ic89c7af3df98c25ff777eebbe1a7e15785ec91ae
Signed-off-by: Bernd Hufmann <bhufmann@gmail.com>
Reviewed-on: https://git.eclipse.org/r/10590
Tested-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
IP-Clean: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
19 files changed:
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ModelImplFactory.java
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/SessionInfoTest.java
org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/AllTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/model/component/TraceControlCreateSessionTests.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/CreateSessionDialogStub.java
org.eclipse.linuxtools.lttng2.ui.tests/testfiles/CreateSessionTest.cfg
org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/CreateSessionDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ICreateSessionDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableUstEvents.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/CreateSessionHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TraceSessionGroup.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/ILttngControlService.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java

index 855fccd7d84eaf3e66560f7de04607e1f6068525..9ff84a553d3a2dc16bd483c7f6e966881226d9f9 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
index 69754f724fc3c6124f2d39ae58e8b6c1da37fa1c..3bdeb5123735cf152e7754d4a53400ab045d678f 100644 (file)
@@ -190,7 +190,7 @@ public class SessionInfoTest {
         String result = fixture.toString();
 
         // add additional test code here
-        assertEquals("[SessionInfo([TraceInfo(Name=sessionName)],State=INACTIVE,Domains=)]", result);
+        assertEquals("[SessionInfo([TraceInfo(Name=sessionName)],State=INACTIVE,isStreamedTrace=false,Domains=)]", result);
     }
 
     /**
@@ -201,7 +201,7 @@ public class SessionInfoTest {
         String result = fSessionInfo1.toString();
 
         // add additional test code here
-        assertEquals("[SessionInfo([TraceInfo(Name=session1)],State=ACTIVE,Domains=[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED)])],isKernel=false)])]", result);
+        assertEquals("[SessionInfo([TraceInfo(Name=session1)],State=ACTIVE,isStreamedTrace=false,Domains=[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED)])],isKernel=false)])]", result);
     }
 
     // ------------------------------------------------------------------------
index 2fa1b61de7bfd98f7935ee984ca6cdbe1bed0848..6778532f6ac9b3932233bdfb0a1291a93fbb7a0c 100644 (file)
@@ -247,6 +247,8 @@ public class SessionInfo extends TraceInfo implements ISessionInfo {
             output.append(super.toString());
             output.append(",State=");
             output.append(fState);
+            output.append(",isStreamedTrace=");
+            output.append(fIsStreamedTrace);
             output.append(",Domains=");
             for (Iterator<IDomainInfo> iterator = fDomains.iterator(); iterator.hasNext();) {
                 IDomainInfo domain = iterator.next();
index 922b8ba54bef056b275ffb94b4fc768f2bec1d04..5398e41fe52bbe80c8a0c53d1bbd04145cba0486 100644 (file)
@@ -22,6 +22,7 @@ import org.junit.runners.Suite;
 @RunWith(Suite.class)
 @Suite.SuiteClasses({
     TraceControlComponentTest.class,
+    TraceControlCreateSessionTests.class,
     TraceControlKernelProviderTests.class,
     TraceControlKernelSessionTests.class,
     TraceControlPropertiesTest.class,
index b1c6e91fe4aa1cd902b44f6d6a1047bc48b59077..1e0754b74e0be2692b1e4c86c999ddf00f0e5ab2 100644 (file)
@@ -50,11 +50,10 @@ public class TraceControlCreateSessionTests {
     // Constants
     // ------------------------------------------------------------------------
     private static final String TEST_STREAM = "CreateSessionTest.cfg";
-    private static final String SCEN_SCENARIO_NO_CONSUMER_TEST = "CreateSessionNoConsumer";
-    private static final String SCEN_SCENARIO_DISABLE_CONSUMER_TEST = "CreateSessionDisableConsumer";
     private static final String SCEN_SCENARIO_FILE_PROTO_TEST = "CreateSessionFileProto";
     private static final String SCEN_SCENARIO_CONTROL_DATA_TEST = "CreateSessionControlData";
     private static final String SCEN_SCENARIO_NETWORK_TEST = "CreateSessionNetwork";
+    private static final String SCEN_SCENARIO_NETWORK2_TEST = "CreateSessionNetwork2";
 
     // ------------------------------------------------------------------------
     // Test data
@@ -77,6 +76,7 @@ public class TraceControlCreateSessionTests {
     @Before
     public void setUp() throws Exception {
         fFacility = TraceControlTestFacility.getInstance();
+        fFacility.init();
         fProxy = new TestRemoteSystemProxy();
         URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
         File testfile = new File(FileLocator.toFileURL(location).toURI());
@@ -135,43 +135,24 @@ public class TraceControlCreateSessionTests {
         TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);
         TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
 
-        // Initialize session handling scenario
-        fProxy.setScenario(SCEN_SCENARIO_NO_CONSUMER_TEST);
-
-        // ------------------------------------------------------------------------
-        // Create session (--no-consumer) and destroy
-        // ------------------------------------------------------------------------
-        // Initialize session handling scenario
-        fProxy.setScenario(SCEN_SCENARIO_NO_CONSUMER_TEST);
-        sessionDialogStub.setNoConsumer(true);
-        TraceSessionComponent session = fFacility.createSession(groups[1]);
-
-        // Verify that session was created
-        assertNotNull(session);
-        assertEquals("mysession", session.getName());
-        assertEquals("", session.getSessionPath());
-        assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-        sessionDialogStub.setNoConsumer(false);
-
-        fFacility.destroySession(session);
-
-        // Verify that no more session components exist
-        assertEquals(0, groups[1].getChildren().length);
-
         // ------------------------------------------------------------------------
-        // Create session (--disable-consumer) and destroy
+        // Create session (--U file://...) and destroy
         // ------------------------------------------------------------------------
         // Initialize session handling scenario
-        fProxy.setScenario(SCEN_SCENARIO_DISABLE_CONSUMER_TEST);
+        fProxy.setScenario(SCEN_SCENARIO_FILE_PROTO_TEST);
 
-        sessionDialogStub.setDisableConsumer(true);
-        session = fFacility.createSession(groups[1]);
+        sessionDialogStub.setNetworkUrl("file:///tmp");
+        sessionDialogStub.setStreamedTrace(true);
+        TraceSessionComponent session = fFacility.createSession(groups[1]);
 
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
+        assertEquals("file:///tmp", session.getSessionPath());
+        assertTrue(!session.isStreamedTrace());
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-        sessionDialogStub.setDisableConsumer(false);
+        sessionDialogStub.setNetworkUrl(null);
+        sessionDialogStub.setStreamedTrace(false);
 
         fFacility.destroySession(session);
 
@@ -179,22 +160,25 @@ public class TraceControlCreateSessionTests {
         assertEquals(0, groups[1].getChildren().length);
 
         // ------------------------------------------------------------------------
-        // Create session (--U file://...) and destroy
+        // Create session (--U file://,,, and destroy
         // ------------------------------------------------------------------------
         // Initialize session handling scenario
-        fProxy.setScenario(SCEN_SCENARIO_FILE_PROTO_TEST);
+        fProxy.setScenario(SCEN_SCENARIO_CONTROL_DATA_TEST);
 
-        sessionDialogStub.setNetworkUrl("file:///tmp");
+        sessionDialogStub.setControlUrl("tcp://172.0.0.1");
+        sessionDialogStub.setDataUrl("tcp://172.0.0.1:5343");
         sessionDialogStub.setStreamedTrace(true);
+
         session = fFacility.createSession(groups[1]);
 
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
-        assertEquals("file:///tmp", session.getSessionPath());
+        assertEquals("tcp://172.0.0.1:5342 [data: 5343]", session.getSessionPath());
         assertTrue(session.isStreamedTrace());
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-        sessionDialogStub.setNetworkUrl(null);
+        sessionDialogStub.setControlUrl(null);
+        sessionDialogStub.setDataUrl(null);
         sessionDialogStub.setStreamedTrace(false);
 
         fFacility.destroySession(session);
@@ -203,13 +187,12 @@ public class TraceControlCreateSessionTests {
         assertEquals(0, groups[1].getChildren().length);
 
         // ------------------------------------------------------------------------
-        // Create session (--U file://,,, and destroy
+        // Create session (--U file://... and destroy
         // ------------------------------------------------------------------------
         // Initialize session handling scenario
-        fProxy.setScenario(SCEN_SCENARIO_CONTROL_DATA_TEST);
+        fProxy.setScenario(SCEN_SCENARIO_NETWORK_TEST);
 
-        sessionDialogStub.setControlUrl("tcp://172.0.0.1");
-        sessionDialogStub.setDataUrl("tcp://172.0.0.1:5343");
+        sessionDialogStub.setNetworkUrl("net://172.0.0.1:1234:2345");
         sessionDialogStub.setStreamedTrace(true);
 
         session = fFacility.createSession(groups[1]);
@@ -217,12 +200,10 @@ public class TraceControlCreateSessionTests {
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
-        assertEquals("tcp://172.0.0.1:5342 [data: 5343]", session.getSessionPath());
+        assertEquals("net://172.0.0.1:1234 [data: 2345]", session.getSessionPath());
         assertTrue(session.isStreamedTrace());
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-        sessionDialogStub.setControlUrl(null);
-        sessionDialogStub.setDataUrl(null);
-        sessionDialogStub.setStreamedTrace(false);
+        sessionDialogStub.setNetworkUrl(null);
 
         fFacility.destroySession(session);
 
@@ -230,12 +211,12 @@ public class TraceControlCreateSessionTests {
         assertEquals(0, groups[1].getChildren().length);
 
         // ------------------------------------------------------------------------
-        // Create session (--U file://,,, and destroy
+        // Create session (--U net6://[...] and destroy
         // ------------------------------------------------------------------------
         // Initialize session handling scenario
-        fProxy.setScenario(SCEN_SCENARIO_NETWORK_TEST);
+        fProxy.setScenario(SCEN_SCENARIO_NETWORK2_TEST);
 
-        sessionDialogStub.setNetworkUrl("net://172.0.0.1:1234:2345");
+        sessionDialogStub.setNetworkUrl("net6://[ffff::eeee:dddd:cccc:0]");
         sessionDialogStub.setStreamedTrace(true);
 
         session = fFacility.createSession(groups[1]);
@@ -243,7 +224,7 @@ public class TraceControlCreateSessionTests {
         // Verify that session was created
         assertNotNull(session);
         assertEquals("mysession", session.getName());
-        assertEquals("net://172.0.0.1:1234 [data: 2345]", session.getSessionPath());
+        assertEquals("net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]", session.getSessionPath());
         assertTrue(session.isStreamedTrace());
         assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
         sessionDialogStub.setNetworkUrl(null);
@@ -253,6 +234,7 @@ public class TraceControlCreateSessionTests {
         // Verify that no more session components exist
         assertEquals(0, groups[1].getChildren().length);
 
+
         //-------------------------------------------------------------------------
         // Disconnect node
         //-------------------------------------------------------------------------
@@ -267,4 +249,4 @@ public class TraceControlCreateSessionTests {
         assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
     }
 
-}
\ No newline at end of file
+}
index 035b4fe730bee2c91ffe8728bd565588c6475192..2c991064789c41099a89fdb1254b41f06c5469ff 100644 (file)
@@ -949,59 +949,41 @@ public class LTTngControlServiceTest {
         }
     }
 
+    @Test
     public void testCreateSession2_1() {
 
         try {
             fShell.setScenario(SCEN_CREATE_SESSION_2_1);
 
-            ISessionInfo info = fService.createSession("mysession", null, true, false, new NullProgressMonitor());
-            assertNotNull(info);
-            assertEquals("mysession", info.getName());
-            assertEquals("", info.getSessionPath());
-            fService.destroySession("mysession", new NullProgressMonitor());
-
-            info = fService.createSession("mysession", "file:///tmp", null, null, true, false, new NullProgressMonitor());
-            assertNotNull(info);
-            assertEquals("mysession", info.getName());
-            assertEquals("", info.getSessionPath());
-            assertTrue(info.isStreamedTrace());
-            fService.destroySession("mysession", new NullProgressMonitor());
-
-            info = fService.createSession("mysession", "net://172.0.0.1", null, null, false, true, new NullProgressMonitor());
+            ISessionInfo info = fService.createSession("mysession", "net://172.0.0.1", null, null, new NullProgressMonitor());
             assertNotNull(info);
             assertEquals("mysession", info.getName());
             assertEquals("net://172.0.0.1", info.getSessionPath());
             assertTrue(info.isStreamedTrace());
             fService.destroySession("mysession", new NullProgressMonitor());
 
-            info = fService.createSession("mysession", null, false, true, new NullProgressMonitor());
-            assertNotNull(info);
-            assertEquals("mysession", info.getName());
-            // >>> no way to verify provided by tracer!!!
-            fService.destroySession("mysession", new NullProgressMonitor());
-
-            info = fService.createSession("mysession", "file:///tmp", null, null, false, false, new NullProgressMonitor());
+            info = fService.createSession("mysession", "file:///tmp", null, null, new NullProgressMonitor());
             assertNotNull(info);
             assertEquals("mysession", info.getName());
             assertEquals("file:///tmp", info.getSessionPath());
             assertTrue(info.isStreamedTrace());
             fService.destroySession("mysession", new NullProgressMonitor());
 
-            info = fService.createSession("mysession", "file:///tmp", null, null, false, false, new NullProgressMonitor());
+            info = fService.createSession("mysession", "file:///tmp", null, null, new NullProgressMonitor());
             assertNotNull(info);
             assertEquals("mysession", info.getName());
             assertEquals("file:///tmp", info.getSessionPath());
             assertTrue(info.isStreamedTrace());
             fService.destroySession("mysession", new NullProgressMonitor());
 
-            info = fService.createSession("mysession", null, "tcp://172.0.0.1", "tcp://172.0.0.1:5343", false, false, new NullProgressMonitor());
+            info = fService.createSession("mysession", null, "tcp://172.0.0.1", "tcp://172.0.0.1:5343", new NullProgressMonitor());
             assertNotNull(info);
             assertEquals("mysession", info.getName());
             assertEquals("", info.getSessionPath()); // TODO: currently there is a bug in LTTng tracer and it returns string null
             assertTrue(info.isStreamedTrace());
             fService.destroySession("mysession", new NullProgressMonitor());
 
-            info = fService.createSession("mysession", "net://172.0.0.1:1234:2345", null, null, false, false, new NullProgressMonitor());
+            info = fService.createSession("mysession", "net://172.0.0.1:1234:2345", null, null, new NullProgressMonitor());
             assertNotNull(info);
             assertEquals("mysession", info.getName());
             assertEquals("net://172.0.0.1:1234:2345", info.getSessionPath());
index 971553d62c3cc73d0a58454476856384a8dcb923..9fc04c2b71160f798e8015e0e740d3c4b24e7a03 100644 (file)
@@ -27,8 +27,6 @@ public class CreateSessionDialogStub implements ICreateSessionDialog {
     private String fNetworkUrl = null;
     private String fControlUrl = null;
     private String fDataUrl = null;
-    private boolean fIsNoConsumer = false;
-    private boolean fIsDisableConsumer = false;
 
     @Override
     public String getSessionName() {
@@ -99,20 +97,4 @@ public class CreateSessionDialogStub implements ICreateSessionDialog {
         this.fDataUrl = fDataUrl;
     }
 
-    @Override
-    public boolean isNoConsumer() {
-        return fIsNoConsumer;
-    }
-    public void setNoConsumer(boolean isNoConsumer) {
-        fIsNoConsumer = isNoConsumer;
-    }
-
-    @Override
-    public boolean isDisableConsumer() {
-        return fIsDisableConsumer;
-    }
-
-    public void setDisableConsumer(boolean isDisableConsumer) {
-        fIsDisableConsumer = isDisableConsumer;
-    }
 }
index e0d79d1e7040f8fbbc659a7c1c376693efd4f119..9b06e931487a4261797b0b019c224d1b41d109cf 100644 (file)
@@ -76,53 +76,18 @@ PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
 ####################################################################
 # Scenario: Test "lttng create <session> with LTTng 2.1 options  
 ####################################################################
-<SCENARIO>
-CreateSessionNoConsumer
-<COMMAND_INPUT>
-lttng create mysession --no-consumer 
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng list mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Tracing session mysession: [inactive]
-    Trace path:
-
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
-</SCENARIO>
 ##################################################################
 <SCENARIO>
-CreateSessionDisableConsumer
+CreateSessionFileProto
 <COMMAND_INPUT>
-lttng create mysession --disable-consumer 
+lttng create mysession -U file:///tmp
 </COMMAND_INPUT>
 <COMMAND_RESULT>
 0
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20120209-095418
+Traces will be written in file:///tmp
 </COMMAND_OUTPUT>
 
 <COMMAND_INPUT>
@@ -133,7 +98,7 @@ lttng list mysession
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Tracing session mysession: [inactive]
-    Trace path: /home/user/lttng-traces/mysession-20120209-095418
+    Trace path: file:///tmp
 
 </COMMAND_OUTPUT>
 
@@ -150,16 +115,17 @@ Session mysession destroyed.
 
 ##################################################################
 <SCENARIO>
-CreateSessionFileProto
+CreateSessionControlData
 <COMMAND_INPUT>
-lttng create mysession -U file:///tmp
+lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
 </COMMAND_INPUT>
 <COMMAND_RESULT>
 0
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Session mysession created.
-Traces will be written in file:///tmp
+Control URL tcp://172.0.0.1 set for session mysession
+Data URL tcp://172.0.0.1:5343 set for session mysession
 </COMMAND_OUTPUT>
 
 <COMMAND_INPUT>
@@ -170,7 +136,7 @@ lttng list mysession
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Tracing session mysession: [inactive]
-    Trace path: file:///tmp
+    Trace path: tcp://172.0.0.1:5342 [data: 5343]
 
 </COMMAND_OUTPUT>
 
@@ -187,17 +153,16 @@ Session mysession destroyed.
 
 ##################################################################
 <SCENARIO>
-CreateSessionControlData
+CreateSessionNetwork
 <COMMAND_INPUT>
-lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
+lttng create mysession -U net://172.0.0.1:1234:2345
 </COMMAND_INPUT>
 <COMMAND_RESULT>
 0
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Session mysession created.
-Control URL tcp://172.0.0.1 set for session mysession
-Data URL tcp://172.0.0.1:5343 set for session mysession
+Traces will be written in net://172.0.0.1:1234:2345
 </COMMAND_OUTPUT>
 
 <COMMAND_INPUT>
@@ -208,7 +173,7 @@ lttng list mysession
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Tracing session mysession: [inactive]
-    Trace path: tcp://172.0.0.1:5342 [data: 5343]
+    Trace path: net://172.0.0.1:1234 [data: 2345]
 
 </COMMAND_OUTPUT>
 
@@ -219,22 +184,23 @@ lttng destroy mysession
 0
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
-Session mysession destroyed.
+Session mysession2 destroyed.
 </COMMAND_OUTPUT>
+
 </SCENARIO>
 
 ##################################################################
 <SCENARIO>
-CreateSessionNetwork
+CreateSessionNetwork2
 <COMMAND_INPUT>
-lttng create mysession -U net://172.0.0.1:1234:2345
+lttng create mysession -U net6://[ffff::eeee:dddd:cccc:0]
 </COMMAND_INPUT>
 <COMMAND_RESULT>
 0
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Session mysession created.
-Traces will be written in net://172.0.0.1:1234:2345
+Traces will be written in net6://[ffff::eeee:dddd:cccc:0]
 </COMMAND_OUTPUT>
 
 <COMMAND_INPUT>
@@ -245,7 +211,7 @@ lttng list mysession
 </COMMAND_RESULT>
 <COMMAND_OUTPUT>
 Tracing session mysession: [inactive]
-    Trace path: net://172.0.0.1:1234 [data: 2345]
+    Trace path:  net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]
 
 </COMMAND_OUTPUT>
 
index fc6a15d5071f4a38d996778e2a14709cdd21e486..9c6e49573fe89d29cfbd895ce1ffc067c799a4c9 100644 (file)
@@ -846,51 +846,9 @@ Kernel calibration done
 ####################################################################
 <SCENARIO>
 CreateSessionLttng2.1
-<COMMAND_INPUT>
-lttng create mysession --no-consumer 
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create mysession -U file:///tmp --no-consumer 
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng destroy mysession
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession destroyed.
-</COMMAND_OUTPUT>
 
 <COMMAND_INPUT>
-lttng create mysession --disable-consumer 
-</COMMAND_INPUT>
-<COMMAND_RESULT>
-0
-</COMMAND_RESULT>
-<COMMAND_OUTPUT>
-Session mysession created.
-Traces will be written in /home/user/lttng-traces/mysession-20120209-095418
-</COMMAND_OUTPUT>
-
-<COMMAND_INPUT>
-lttng create mysession -U net://172.0.0.1 --disable-consumer 
+lttng create mysession -U net://172.0.0.1
 </COMMAND_INPUT>
 <COMMAND_RESULT>
 0
@@ -934,4 +892,14 @@ Session mysession created.
 Traces will be written in net://172.0.0.1:1234:2345
 </COMMAND_OUTPUT>
 
+<COMMAND_INPUT>
+lttng destroy mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession destroyed.
+</COMMAND_OUTPUT>
+
 </SCENARIO>
index f021a63cf8b137808c185c8d3cf3999fdd101d38..fb61d3d1ee078e4a418756677d249a3515db9131 100644 (file)
@@ -26,8 +26,8 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSys
 import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Point;
@@ -103,6 +103,10 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      * The text widget for the session name
      */
     private Text fSessionNameText = null;
+    /**
+     * The label widget for the session path.
+     */
+    private Label fSessionPathLabel = null;
     /**
      * The text widget for the session path.
      */
@@ -119,6 +123,10 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      * The composite with streaming configuration parameter.
      */
     private Composite fStreamingComposite = null;
+    /**
+     * The text widget for the trace path.
+     */
+    private Text fTracePathText = null;
     /**
      * The button to link data protocol/Address with control protocol.
      */
@@ -131,10 +139,14 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      * A selection listener that copies the protocol from control to data when being linked.
      */
     private ControlProtocolSelectionListener fCopyProtocolSelectionListener;
-
+    /**
+     * A selection listener updates the control port text depending on the control protocol selected.
+     */
     private ProtocolComboSelectionListener fControlProtocolSelectionListener;
+    /**
+     * A selection listener updates the data port text depending on the data protocol selected.
+     */
     private ProtocolComboSelectionListener fDataProtocolSelectionListener;
-
     /**
      * The text box for the host/IP address of the control channel.
      */
@@ -142,7 +154,7 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
     /**
      * A key listener that copies the host address from control to data when being linked.
      */
-    private CopyKeyListener fControlUrlKeyListener;
+    private CopyModifyListener fControlUrlKeyListener;
     /**
      * The text box for the control port.
      */
@@ -159,14 +171,6 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      * The text box for the data port.
      */
     private Text fDataPortText = null;
-    /**
-     * The button to not activate a consumer.
-     */
-    private Button fNoConsumerButton = null;
-    /**
-     * The button to disable the consumer.
-     */
-    private Button fDisableConsumerButton = null;
     /**
      * The parent where the new node should be added.
      */
@@ -203,13 +207,9 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
      */
     private String fDataUrl = null;
     /**
-     * Flag for not activating a consumer for this session.
-     */
-    private boolean fIsNoConsumer = false;
-    /**
-     * Flag for disabling a consumer for this session.
+     * The trace path string.
      */
-    private boolean fIsDisableConsumer = false;
+    private String fTracePath = null;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -268,8 +268,6 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
        fNetworkUrl = null;
        fControlUrl = null;
        fDataUrl = null;
-       fIsNoConsumer = false;
-       fIsDisableConsumer = false;
     }
 
     @Override
@@ -289,16 +287,6 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         return fDataUrl;
     }
 
-    @Override
-    public boolean isNoConsumer() {
-        return fIsNoConsumer;
-    }
-
-    @Override
-    public boolean isDisableConsumer() {
-        return fIsDisableConsumer;
-    }
-
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -351,8 +339,8 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         fSessionNameText = new Text(sessionGroup, SWT.NONE);
         fSessionNameText.setToolTipText(Messages.TraceControl_CreateSessionNameTooltip);
 
-        Label sessionPath = new Label(sessionGroup, SWT.RIGHT);
-        sessionPath.setText(Messages.TraceControl_CreateSessionPathLabel);
+        fSessionPathLabel = new Label(sessionGroup, SWT.RIGHT);
+        fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
         fSessionPathText = new Text(sessionGroup, SWT.NONE);
         fSessionPathText.setToolTipText(Messages.TraceControl_CreateSessionPathTooltip);
 
@@ -367,38 +355,6 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         fSessionPathText.setLayoutData(data);
 
         if (fParent.isNetworkStreamingSupported()) {
-            fNoConsumerButton = new Button(sessionGroup, SWT.CHECK);
-            fNoConsumerButton.setText(Messages.TraceControl_CreateSessionNoConsumertText);
-            fNoConsumerButton.setToolTipText(Messages.TraceControl_CreateSessionNoConsumertTooltip);
-            data = new GridData(GridData.FILL_HORIZONTAL);
-            data.horizontalSpan = 2;
-            fNoConsumerButton.setLayoutData(data);
-
-            fDisableConsumerButton = new Button(sessionGroup, SWT.CHECK);
-            fDisableConsumerButton.setText(Messages.TraceControl_CreateSessionDisableConsumertText);
-            fDisableConsumerButton.setToolTipText(Messages.TraceControl_CreateSessionDisableConsumertTooltip);
-            data = new GridData(GridData.FILL_HORIZONTAL);
-            data.horizontalSpan = 2;
-            fDisableConsumerButton.setLayoutData(data);
-
-            fNoConsumerButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    if (fNoConsumerButton.getSelection()) {
-                        fDisableConsumerButton.setSelection(false);
-                    }
-                }
-            });
-
-            fDisableConsumerButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    if (fDisableConsumerButton.getSelection()) {
-                        fNoConsumerButton.setSelection(false);
-                    }
-                }
-            });
-
             createAdvancedOptionsComposite();
         }
 
@@ -412,7 +368,7 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         fMainStreamingGroup.setLayout(new GridLayout(1, true));
 
         fConfigureStreamingButton = new Button(fMainStreamingGroup, SWT.PUSH);
-        fConfigureStreamingButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$
+        fConfigureStreamingButton.setText(Messages.TraceControl_CreateSessionConfigureStreamingButtonText + " >>>"); //$NON-NLS-1$
         fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
         fConfigureStreamingButton.addSelectionListener(new SelectionAdapter() {
             @Override
@@ -421,11 +377,16 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
                     fIsStreamedTrace = false;
                     fConfigureStreamingButton.setText(">>> " + Messages.TraceControl_CreateSessionConfigureStreamingButtonText); //$NON-NLS-1$
                     fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionConfigureStreamingButtonTooltip);
+                    fSessionPathText.setEnabled(true);
+                    fSessionPathLabel.setText(Messages.TraceControl_CreateSessionPathLabel);
                     disposeConfigureStreamingComposite();
                 } else {
                     fIsStreamedTrace = true;
                     fConfigureStreamingButton.setText("<<< " + Messages.TraceControl_CreateSessionNoStreamingButtonText); //$NON-NLS-1$
                     fConfigureStreamingButton.setToolTipText(Messages.TraceControl_CreateSessionNoStreamingButtonTooltip);
+                    fSessionPathText.setEnabled(false);
+                    fSessionPathText.setText(""); //$NON-NLS-1$
+                    fSessionPathLabel.setText(""); //$NON-NLS-1$
                     createConfigureStreamingComposite();
                 }
 
@@ -450,10 +411,20 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
             urlGroup.setLayout(layout);
             urlGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
 
+            Label tracePathLabel = new Label(urlGroup, SWT.RIGHT);
+            tracePathLabel.setText(Messages.TraceControl_CreateSessionTracePathText);
+            fTracePathText = new Text(urlGroup, SWT.NONE);
+            fTracePathText.setToolTipText(Messages.TraceControl_CreateSessionTracePathTooltip);
+
+            // layout widgets
+            GridData data = new GridData(GridData.FILL_HORIZONTAL);
+            data.horizontalSpan = 6;
+            fTracePathText.setLayoutData(data);
+
             fLinkDataWithControlButton = new Button(urlGroup, SWT.CHECK);
             fLinkDataWithControlButton.setText(Messages.TraceControl_CreateSessionLinkButtonText);
             fLinkDataWithControlButton.setToolTipText(Messages.TraceControl_CreateSessionLinkButtonTooltip);
-            GridData data = new GridData(GridData.FILL_HORIZONTAL);
+            data = new GridData(GridData.FILL_HORIZONTAL);
             data.horizontalSpan = 7;
             fLinkDataWithControlButton.setLayoutData(data);
             fLinkDataWithControlButton.setSelection(true);
@@ -545,19 +516,9 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
 
             fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener);
 
-            fControlUrlKeyListener = new CopyKeyListener(fControlHostAddressText, fDataHostAddressText);
-            fControlHostAddressText.addKeyListener(fControlUrlKeyListener);
-
-//            InetAddress inet = null;
-//            try {
-//                inet = InetAddress.getLocalHost();
-//                inet = InetAddress.getByName(inet.getHostName());
-//            } catch (UnknownHostException e1) {
-//            }
-//            if (inet != null) {
-//                fControlUrlAddressText.setText(inet.getHostAddress());
-//                fDataUrlAddressText.setText(inet.getHostAddress());
-//            }
+            fControlUrlKeyListener = new CopyModifyListener(fControlHostAddressText, fDataHostAddressText);
+            fControlHostAddressText.addModifyListener(fControlUrlKeyListener);
+
             fControlProtocolCombo.select(DEFAULT_URL_INDEX);
             fDataProtocolCombo.select(DEFAULT_URL_INDEX);
 
@@ -575,7 +536,7 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
                         fControlProtocolCombo.removeSelectionListener(fControlProtocolSelectionListener);
                         fDataProtocolCombo.removeSelectionListener(fDataProtocolSelectionListener);
                         fControlProtocolCombo.addSelectionListener(fCopyProtocolSelectionListener);
-                        fControlHostAddressText.addKeyListener(fControlUrlKeyListener);
+                        fControlHostAddressText.addModifyListener(fControlUrlKeyListener);
 
                         // Get previous selection and validate
                         int currentSelection = fControlProtocolCombo.getSelectionIndex() <= COMMON_URL_LAST_INDEX ?
@@ -606,7 +567,7 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
                         fControlProtocolCombo.removeSelectionListener(fCopyProtocolSelectionListener);
                         fControlProtocolCombo.addSelectionListener(fControlProtocolSelectionListener);
                         fDataProtocolCombo.addSelectionListener(fDataProtocolSelectionListener);
-                        fControlHostAddressText.removeKeyListener(fControlUrlKeyListener);
+                        fControlHostAddressText.removeModifyListener(fControlUrlKeyListener);
 
                         // Update combo box items
                         int currentSelection = fControlProtocolCombo.getSelectionIndex();
@@ -706,6 +667,9 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         fDataUrl = null;
 
         if (fIsStreamedTrace) {
+            // Validate input data
+            fTracePath = fTracePathText.getText();
+
             if (fControlProtocolCombo.getSelectionIndex() < 0) {
                 MessageDialog.openError(getShell(),
                         Messages.TraceControl_CreateSessionDialogTitle,
@@ -739,19 +703,19 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
                         fControlHostAddressText.getText(),
                         fControlPortText.getText(),
                         null,
-                        fSessionPath);
+                        fTracePath);
 
                 fDataUrl = getUrlString(fControlProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()),
                         fDataHostAddressText.getText(),
                         null,
                         fDataPortText.getText(),
-                        fSessionPath);
+                        fTracePath);
             } else {
                 fNetworkUrl = getUrlString(fControlProtocolCombo.getItem(fDataProtocolCombo.getSelectionIndex()),
                         fControlHostAddressText.getText(),
                         fControlPortText.getText(),
                         fDataPortText.getText(),
-                        fSessionPath);
+                        fTracePath);
             }
         }
 
@@ -771,11 +735,6 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
             return;
         }
 
-        if (fParent.isNetworkStreamingSupported()) {
-            fIsNoConsumer = fNoConsumerButton.getSelection();
-            fIsDisableConsumer = fDisableConsumerButton.getSelection();
-        }
-
         // validation successful -> call super.okPressed()
         super.okPressed();
     }
@@ -804,17 +763,17 @@ public class CreateSessionDialog extends Dialog implements ICreateSessionDialog
         return stringBuilder.toString();
     }
 
-    private static class CopyKeyListener extends KeyAdapter {
+    private static class CopyModifyListener implements ModifyListener {
         private Text fSource;
         private Text fDestination;
 
-        public CopyKeyListener(Text source, Text destination) {
+        public CopyModifyListener(Text source, Text destination) {
             fSource = source;
             fDestination = destination;
         }
 
         @Override
-        public void keyReleased(KeyEvent e) {
+        public void modifyText(ModifyEvent e) {
             fDestination.setText(fSource.getText());
         }
     }
index c7f6b1080319d80889b6c25d449d3f72ebc65557..066b1458a68cc82437f2759c8385a7f1ccf69911 100644 (file)
@@ -77,16 +77,6 @@ public interface ICreateSessionDialog {
      */
     public String getDataUrl();
 
-    /**
-     * @return for not activating a consumer for this session
-     */
-    public boolean isNoConsumer();
-
-    /**
-     * @return for disabling a consumer for this session
-     */
-    public boolean isDisableConsumer();
-
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
index 2377ac3043a520a098bd864f0af85f4d62c725e3..e42d9c31f404b8c70cb688ea88a583a59e5e499c 100644 (file)
@@ -74,11 +74,10 @@ public class CreateSessionHandler extends BaseControlViewHandler {
                     try {
                         if (dialog.isStreamedTrace()) {
                             sessionGroup.createSession(dialog.getSessionName(), dialog.getNetworkUrl(), dialog.getControlUrl(),
-                                    dialog.getDataUrl(), dialog.isNoConsumer(), dialog.isDisableConsumer(), monitor);
+                                    dialog.getDataUrl(), monitor);
                         } else {
                             String sessionPath = dialog.isDefaultSessionPath() ? null : dialog.getSessionPath();
-                            sessionGroup.createSession(dialog.getSessionName(), sessionPath, dialog.isNoConsumer(),
-                                    dialog.isDisableConsumer(), monitor);
+                            sessionGroup.createSession(dialog.getSessionName(), sessionPath, monitor);
                         }
                     } catch (ExecutionException e) {
                         return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e);
index 61afa31d1539affb294ffec52f858ea8ee8412e1..cad9d6b7db7430956180869e698aa7b0edc00a41 100644 (file)
@@ -103,6 +103,8 @@ final public class Messages extends NLS {
     public static String TraceControl_CreateSessionConfigureStreamingButtonTooltip;
     public static String TraceControl_CreateSessionNoStreamingButtonText;
     public static String TraceControl_CreateSessionNoStreamingButtonTooltip;
+    public static String TraceControl_CreateSessionTracePathText;
+    public static String TraceControl_CreateSessionTracePathTooltip;
     public static String TraceControl_CreateSessionLinkButtonText;
     public static String TraceControl_CreateSessionLinkButtonTooltip;
     public static String TraceControl_CreateSessionProtocolLabelText;
index e6a89c578a1ff08b39eea95baa13462c2f44b533..0001a33226446a274074ad8e0943bacb37f3c9f0 100644 (file)
@@ -82,10 +82,12 @@ TraceControl_CreateSessionNameTooltip=The name of the session to be created.
 TraceControl_CreateSessionPathLabel=Session Path
 TraceControl_CreateSessionPathTooltip=The session path (keep empty for default location)
 
-TraceControl_CreateSessionConfigureStreamingButtonText=Configure Streaming
-TraceControl_CreateSessionConfigureStreamingButtonTooltip=Configure streaming parameters
-TraceControl_CreateSessionNoStreamingButtonText=Remove Streaming
-TraceControl_CreateSessionNoStreamingButtonTooltip=Remove streaming configuration
+TraceControl_CreateSessionConfigureStreamingButtonText=Advanced
+TraceControl_CreateSessionConfigureStreamingButtonTooltip=Configure advanced options
+TraceControl_CreateSessionNoStreamingButtonText=Basic
+TraceControl_CreateSessionNoStreamingButtonTooltip=Use basic options
+TraceControl_CreateSessionTracePathText=Trace Path
+TraceControl_CreateSessionTracePathTooltip=The trace path (keep empty for default location)
 TraceControl_CreateSessionLinkButtonText=Synchronize data with control configuration
 TraceControl_CreateSessionLinkButtonTooltip=Synchronize data protocol and host address with control channel configuration
 TraceControl_CreateSessionProtocolLabelText=Protocol
index 20e315d99ad8e39f611df8255b5bce001e1149e9..8dea7aeb06868642a43a974bce10d702ae8c564f 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *   Bernd Hufmann - Initial API and implementation
+ *   Bernd Hufmann - Updated for support of LTTng Tools 2.1
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl;
 
@@ -108,15 +109,11 @@ public class TraceSessionGroup extends TraceControlComponent {
      *            - a session name to create
      * @param sessionPath
      *            - a path for storing the traces (use null for default)
-     * @param noConsumer
-     *            - a flag to indicate no consumer
-     * @param disableConsumer
-     *            - a flag to disable consumer
      * @throws ExecutionException
      *             If the command fails
      */
-    public void createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer) throws ExecutionException {
-        createSession(sessionName, sessionPath, noConsumer, disableConsumer, new NullProgressMonitor());
+    public void createSession(String sessionName, String sessionPath) throws ExecutionException {
+        createSession(sessionName, sessionPath, new NullProgressMonitor());
     }
 
     /**
@@ -126,17 +123,13 @@ public class TraceSessionGroup extends TraceControlComponent {
      *            - a session name to create
      * @param sessionPath
      *            - a path for storing the traces (use null for default)
-     * @param noConsumer
-     *            - a flag to indicate no consumer
-     * @param disableConsumer
-     *            - a flag to disable consumer
      * @param monitor
      *            - a progress monitor
      * @throws ExecutionException
      *             If the command fails
      */
-    public void createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer, IProgressMonitor monitor) throws ExecutionException {
-        ISessionInfo sessionInfo = getControlService().createSession(sessionName, sessionPath, noConsumer, disableConsumer, monitor);
+    public void createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException {
+        ISessionInfo sessionInfo = getControlService().createSession(sessionName, sessionPath, monitor);
 
         if (sessionInfo != null) {
             TraceSessionComponent session = new TraceSessionComponent(
@@ -158,15 +151,11 @@ public class TraceSessionGroup extends TraceControlComponent {
      *            - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
      * @param dataUrl
      *            - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
-     * @param noConsumer
-     *            - a flag to indicate no consumer
-     * @param disableConsumer
-     *            - a flag to disable consumer
      * @throws ExecutionException
      *             If the command fails
      */
-    public void createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, boolean noConsumer, boolean disableConsumer) throws ExecutionException {
-        createSession(sessionName, networkUrl, controlUrl, dataUrl, noConsumer, disableConsumer, new NullProgressMonitor());
+    public void createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl) throws ExecutionException {
+        createSession(sessionName, networkUrl, controlUrl, dataUrl, new NullProgressMonitor());
     }
 
     /**
@@ -181,17 +170,13 @@ public class TraceSessionGroup extends TraceControlComponent {
      *            - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
      * @param dataUrl
      *            - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
-     * @param noConsumer
-     *            - a flag to indicate no consumer
-     * @param disableConsumer
-     *            - a flag to disable consumer
      * @param monitor
      *            - a progress monitor
      * @throws ExecutionException
      *             If the command fails
      */
-    public void createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, boolean noConsumer, boolean disableConsumer, IProgressMonitor monitor) throws ExecutionException {
-        ISessionInfo sessionInfo = getControlService().createSession(sessionName, networkUrl, controlUrl, dataUrl, noConsumer, disableConsumer, monitor);
+    public void createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, IProgressMonitor monitor) throws ExecutionException {
+        ISessionInfo sessionInfo = getControlService().createSession(sessionName, networkUrl, controlUrl, dataUrl, monitor);
 
         if (sessionInfo != null) {
             TraceSessionComponent session = new TraceSessionComponent(sessionInfo.getName(), TraceSessionGroup.this);
index b07196028bd77243db2acd52e203846a4a20539a..cecee4fd6d1457012e1c369f617a179388ba2555 100644 (file)
@@ -118,29 +118,7 @@ public interface ILttngControlService {
      * @throws ExecutionException
      *             If the command fails
      */
-    public ISessionInfo createSession(String sessionName, String sessionPath,
-            IProgressMonitor monitor) throws ExecutionException;
-
-    /**
-     * Creates a session with given session name and location.
-     *
-     * @param sessionName
-     *            - a session name to create
-     * @param sessionPath
-     *            - a path for storing the traces (use null for default)
-     * @param noConsumer
-     *            - a flag to indicate no consumer
-     * @param disableConsumer
-     *            - a flag to disable consumer
-     * @param monitor
-     *            - a progress monitor
-     * @return the session information
-     * @throws ExecutionException
-     *             If the command fails
-     */
-    public ISessionInfo createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer,
-            IProgressMonitor monitor) throws ExecutionException;
-
+    public ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException;
 
     /**
      * Creates a session with given session name and location.
@@ -154,18 +132,13 @@ public interface ILttngControlService {
      *            - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
      * @param dataUrl
      *            - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
-     * @param noConsumer
-     *            - a flag to indicate no consumer
-     * @param disableConsumer
-     *            - a flag to disable consumer
      * @param monitor
      *            - a progress monitor
      * @return the session information
      * @throws ExecutionException
      *             If the command fails
      */
-    public ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, boolean noConsumer, boolean disableConsumer,
-            IProgressMonitor monitor) throws ExecutionException;
+    public ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, IProgressMonitor monitor) throws ExecutionException;
 
     /**
      * Destroys a session with given session name.
index c31c31e8728f761eb7fd305eca156dc07b0bedf3..fd056175be7c0b36642796b654501079544af7e6 100644 (file)
@@ -201,34 +201,42 @@ public class LTTngControlService implements ILttngControlService {
             if (matcher.matches()) {
                 // Create Domain
                 IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_KernelDomainDisplayName);
-                sessionInfo.addDomain(domainInfo);
 
                 // in domain kernel
                 ArrayList<IChannelInfo> channels = new ArrayList<IChannelInfo>();
                 index = parseDomain(result.getOutput(), index, channels);
 
-                // set channels
-                domainInfo.setChannels(channels);
+                if (channels.size() > 0) {
+                    // add domain
+                    sessionInfo.addDomain(domainInfo);
 
-                // set kernel flag
-                domainInfo.setIsKernel(true);
+                    // set channels
+                    domainInfo.setChannels(channels);
+
+                    // set kernel flag
+                    domainInfo.setIsKernel(true);
+                }
                 continue;
             }
 
             matcher = LTTngControlServiceConstants.DOMAIN_UST_GLOBAL_PATTERN.matcher(line);
             if (matcher.matches()) {
                 IDomainInfo domainInfo = new DomainInfo(Messages.TraceControl_UstGlobalDomainDisplayName);
-                sessionInfo.addDomain(domainInfo);
 
                 // in domain UST
                 ArrayList<IChannelInfo> channels = new ArrayList<IChannelInfo>();
                 index = parseDomain(result.getOutput(), index, channels);
 
-                // set channels
-                domainInfo.setChannels(channels);
+                if (channels.size() > 0) {
+                    // add domain
+                    sessionInfo.addDomain(domainInfo);
+
+                    // set channels
+                    domainInfo.setChannels(channels);
 
-                // set kernel flag
-                domainInfo.setIsKernel(false);
+                    // set kernel flag
+                    domainInfo.setIsKernel(false);
+                }
                 continue;
             }
             index++;
@@ -355,12 +363,6 @@ public class LTTngControlService implements ILttngControlService {
      */
     @Override
     public ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException {
-        return createSession(sessionName, sessionPath, false, false, monitor);
-    }
-
-    @Override
-    public ISessionInfo createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer,
-            IProgressMonitor monitor) throws ExecutionException {
 
         String newName = formatParameter(sessionName);
         String newPath = formatParameter(sessionPath);
@@ -372,12 +374,6 @@ public class LTTngControlService implements ILttngControlService {
             command.append(newPath);
         }
 
-        if (noConsumer) {
-            command.append(LTTngControlServiceConstants.OPTION_NO_CONSUMER);
-        } else if (disableConsumer) {
-            command.append(LTTngControlServiceConstants.OPTION_DISABLE_CONSUMER);
-        }
-
         ICommandResult result = executeCommand(command.toString(), monitor);
 
         //Session myssession2 created.
@@ -405,27 +401,25 @@ public class LTTngControlService implements ILttngControlService {
 
         SessionInfo sessionInfo = new SessionInfo(name);
 
-        if (!noConsumer) {
-            // Get and verify session path
-            matcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(output[1]);
-            String path = null;
+        // Get and verify session path
+        matcher = LTTngControlServiceConstants.CREATE_SESSION_PATH_PATTERN.matcher(output[1]);
+        String path = null;
 
-            if (matcher.matches()) {
-                path = String.valueOf(matcher.group(1).trim());
-            } else {
-                // Output format not expected
-                throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
-                        Messages.TraceControl_UnexpectedCommandOutputFormat + ":\n" + //$NON-NLS-1$
-                        formatOutput(result));
-            }
+        if (matcher.matches()) {
+            path = String.valueOf(matcher.group(1).trim());
+        } else {
+            // Output format not expected
+            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+                    Messages.TraceControl_UnexpectedCommandOutputFormat + ":\n" + //$NON-NLS-1$
+                    formatOutput(result));
+        }
 
-            if ((path == null) || ((sessionPath != null) && (!path.contains(sessionPath)))) {
-                // Unexpected path
-                throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
-                        Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$
-            }
-            sessionInfo.setSessionPath(path);
+        if ((path == null) || ((sessionPath != null) && (!path.contains(sessionPath)))) {
+            // Unexpected path
+            throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+                    Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$
         }
+        sessionInfo.setSessionPath(path);
 
         return sessionInfo;
 
@@ -433,11 +427,10 @@ public class LTTngControlService implements ILttngControlService {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#createSession(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor)
+     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#createSession(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
      */
     @Override
-    public ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl,
-            String dataUrl, boolean noConsumer, boolean disableConsumer, IProgressMonitor monitor) throws ExecutionException {
+    public ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, IProgressMonitor monitor) throws ExecutionException {
 
         String newName = formatParameter(sessionName);
         StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName);
@@ -453,12 +446,6 @@ public class LTTngControlService implements ILttngControlService {
             command.append(dataUrl);
         }
 
-        if (noConsumer) {
-            command.append(LTTngControlServiceConstants.OPTION_NO_CONSUMER);
-        } else if (disableConsumer) {
-            command.append(LTTngControlServiceConstants.OPTION_DISABLE_CONSUMER);
-        }
-
         ICommandResult result = executeCommand(command.toString(), monitor);
 
         //Session myssession2 created.
@@ -482,7 +469,7 @@ public class LTTngControlService implements ILttngControlService {
         String path = null;
 
         SessionInfo sessionInfo = new SessionInfo(name);
-        if (!noConsumer && (networkUrl != null)) {
+        if (networkUrl != null) {
             if (matcher.matches()) {
                 path = String.valueOf(matcher.group(1).trim());
             } else {
@@ -1005,6 +992,8 @@ public class LTTngControlService implements ILttngControlService {
             String line = output[index];
 
             Matcher outerMatcher = LTTngControlServiceConstants.CHANNELS_SECTION_PATTERN.matcher(line);
+            Matcher noKernelChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_KERNEL_CHANNEL_PATTERN.matcher(line);
+            Matcher noUstChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_UST_CHANNEL_PATTERN.matcher(line);
             if (outerMatcher.matches()) {
                 IChannelInfo channelInfo = null;
                 while (index < output.length) {
@@ -1069,6 +1058,10 @@ public class LTTngControlService implements ILttngControlService {
                     }
                     index++;
                 }
+            } else if (noKernelChannelMatcher.matches() || noUstChannelMatcher.matches()) {
+                // domain indicates that no channels were found -> return
+                index++;
+                return index;
             }
             index++;
         }
index ac50f4fa3678f55f03eda162ec513676db408174..79295b5fada539793e1afb999a0edea8b79a3b05 100644 (file)
@@ -214,14 +214,6 @@ public class LTTngControlServiceConstants {
      * Command line option for configuring the streaming data URL.
      */
     public final static String OPTION_DATA_URL = " -D "; //$NON-NLS-1$
-    /**
-     * Command line option for configuring of no consumer.
-     */
-    public final static String OPTION_NO_CONSUMER = " --no-consumer "; //$NON-NLS-1$
-    /**
-     * Command line option for disabling the consumer.
-     */
-    public final static String OPTION_DISABLE_CONSUMER = " --disable-consumer "; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Parsing constants
@@ -247,9 +239,10 @@ public class LTTngControlServiceConstants {
      */
     public final static Pattern TRACE_SESSION_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(.*)"); //$NON-NLS-1$
     /**
-     * Patter to match session path for network tracing (lttng list <session>)
+     * Pattern to match session path for network tracing (lttng list <session>)
+     * Note: file for protocol is not considered as network trace since local consumer will be used.
      */
-    public final static Pattern TRACE_NETWORK_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net6|file|tcp|tcp6|)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
+    public final static Pattern TRACE_NETWORK_PATH_PATTERN = Pattern.compile("\\s*Trace\\s+path\\:\\s+(net|net6|tcp|tcp6|)\\:\\/\\/(.*)(\\:(\\d*)\\/(.*)\\[data\\:\\s+(\\d*)\\]){0,1}"); //$NON-NLS-1$
     /**
      * Pattern to match for kernel domain information (lttng list <session>)
      */
@@ -258,6 +251,14 @@ public class LTTngControlServiceConstants {
      * Pattern to match for ust domain information (lttng list <session>)
      */
     public final static Pattern DOMAIN_UST_GLOBAL_PATTERN = Pattern.compile("=== Domain: UST global ==="); //$NON-NLS-1$
+    /**
+     * Pattern to match for matching warning about no kernel channel
+     */
+    public final static Pattern DOMAIN_NO_KERNEL_CHANNEL_PATTERN = Pattern.compile("\\s*Warning\\:\\s+No kernel\\s+channel.*"); //$NON-NLS-1$
+    /**
+     * Pattern to match for matching warning about no UST channel
+     */
+    public final static Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$
     /**
      * Pattern to match for channels section (lttng list <session>)
      */
@@ -329,7 +330,6 @@ public class LTTngControlServiceConstants {
     /**
      * Pattern to match event fields
      */
-    //                                                                 field: content (string)
     public final static Pattern EVENT_FIELD_PATTERN = Pattern.compile("\\s*(field:)\\s+(.*)\\s+\\((.*)\\)"); //$NON-NLS-1$
     /**
      * Pattern to match for UST provider information (lttng list -u)
This page took 0.047531 seconds and 5 git commands to generate.