Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2014-04-04 09:39:23 -0400
committerBernd Hufmann2014-05-09 15:03:14 -0400
commitaca663e78d4cfc6066bccfab18be71cf361f882e (patch)
tree4084f506937303a4e9f2577caece13c7c489194d
parente866fae2d8a67985051ef8afba50ed37b4eea105 (diff)
downloadorg.eclipse.linuxtools-aca663e78d4cfc6066bccfab18be71cf361f882e.tar.gz
org.eclipse.linuxtools-aca663e78d4cfc6066bccfab18be71cf361f882e.tar.xz
org.eclipse.linuxtools-aca663e78d4cfc6066bccfab18be71cf361f882e.zip
lttng: Allow local host connection (non SSH) for LTTng control
Change-Id: I937c76141195f02d5c3694327e4e085764cd00c4 Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com> Reviewed-on: https://git.eclipse.org/r/26300 Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java5
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java12
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java6
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java8
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java7
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java5
6 files changed, 34 insertions, 9 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java
index e4125a985c..19de1fcd39 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/service/TestRemoteSystemProxy.java
@@ -110,4 +110,9 @@ public class TestRemoteSystemProxy implements IRemoteSystemProxy {
@Override
public void setPort(int port) {
}
+
+ @Override
+ public boolean isLocal() {
+ return false;
+ }
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java
index 41271b40dd..04bfccea7a 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/handlers/NewConnectionHandler.java
@@ -153,13 +153,11 @@ public class NewConnectionHandler extends BaseControlViewHandler {
.getHostsBySubSystemConfigurationCategory("shells"))); //$NON-NLS-1$
for (IHost connection : shellConnections) {
- if (!connection.getSystemType().isLocal()) {
- ISubSystem[] subSystems = connection.getSubSystems();
- for (int i = 0; i < subSystems.length; i++) {
- if (subSystems[i] instanceof IFileServiceSubSystem) {
- result.add(connection);
- break;
- }
+ ISubSystem[] subSystems = connection.getSubSystems();
+ for (int i = 0; i < subSystems.length; i++) {
+ if (subSystems[i] instanceof IFileServiceSubSystem) {
+ result.add(connection);
+ break;
}
}
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java
index f100ca0faf..a8df138e10 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/model/impl/TargetNodeComponent.java
@@ -383,7 +383,11 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
*/
public void deregister() {
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
- registry.deleteHost(fHost);
+ // Don't remove local host because it cannot be recreated by
+ // LTTng NewConnection Dialog
+ if (!fRemoteProxy.isLocal()) {
+ registry.deleteHost(fHost);
+ }
}
// ------------------------------------------------------------------------
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java
index f13d20e797..2a94a9c1f1 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java
@@ -98,7 +98,13 @@ public class CommandShell implements ICommandShell {
IShellService shellService = fProxy.getShellService();
Process p = null;
try {
- fHostShell = shellService.launchShell("", new String[0], new NullProgressMonitor()); //$NON-NLS-1$
+ String[] env = new String[0];
+
+ if (fProxy.isLocal()) {
+ env = shellService.getHostEnvironment();
+ }
+
+ fHostShell = shellService.launchShell("", env, new NullProgressMonitor()); //$NON-NLS-1$
p = new HostShellProcessAdapter(fHostShell);
} catch (Exception e) {
throw new ExecutionException(Messages.TraceControl_CommandShellError, e);
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java
index 56ad98623c..c91d82a006 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/IRemoteSystemProxy.java
@@ -130,4 +130,11 @@ public interface IRemoteSystemProxy {
*/
void removeCommunicationListener(ICommunicationsListener listener);
+ /**
+ * Checks whether the local host connector service is used or not.
+ *
+ * @return <code>true</code> if local connection else <false>
+ *
+ */
+ public boolean isLocal();
} \ No newline at end of file
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java
index 5686c3661e..8ddc210ea5 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/RemoteSystemProxy.java
@@ -195,4 +195,9 @@ public class RemoteSystemProxy implements IRemoteSystemProxy {
cs.removeCommunicationsListener(listener);
}
}
+
+ @Override
+ public boolean isLocal() {
+ return fHost.getSystemType().isLocal();
+ }
}

Back to the top