| Summary: | Change RuntimeProcessFactory to use file and process proxies | ||
|---|---|---|---|
| Product: | [Tools] Linux Tools | Reporter: | Rafael Medeiros Teixeira <rafaelmt> |
| Component: | Project | Assignee: | Otavio Pontes <obusatto> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | danielhb, jjohnstn, obusatto, rafaelmt, rfaraujo |
| Version: | unspecified | ||
| Target Milestone: | 1.1 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | 377120 | ||
| Bug Blocks: | 315505, 382060, 382882 | ||
| Attachments: | |||
|
Description
Rafael Medeiros Teixeira
Created attachment 215063 [details]
Patch to use file and process proxies in RuntimeProcessFactory
I'm working with remote Perf and this change is welcome. I've tested it and it doesn't break any existing plug-ins and maven build, so I've pushed it to master. Previous patch caused Oprofile to fail. Reopening Created attachment 215989 [details] Patch to use file and process proxies in RuntimeProcessFactory Note: this fix requires that Bug 377120 is fixed. It also needs to have Xavier Raynaud's patch re-applied (also attached to this bug). Created attachment 215990 [details]
RuntimeProcessFactory: just return command in "which" method if the project is null
Created attachment 216600 [details]
Patch to use file and process proxies in RuntimeProcessFactory
Local projects were failing because their URI have the "host" property equals null instead of localhost, thus won't use the local proxy manager (the default one). Added a check for null hosts at RemoteProxyManager.
This would be an API-breaking change wouldn't it ? (https://hudson.eclipse.org/hudson/job/linuxtools-master/javadoc/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.html) ? I guess we could deprecate it the old ones and have the new methods as well. Also, I seem to be getting an error : For example, if I want to create a new OProfile launch configuration, the configuration tabs must be populated with data from "ophelp -X" (for the events), but this command is just global data, so it's project-independent. The project passed to whichCommand is null (OProfileProject isn't set to anything), and so we get this error s since proxy stays null, and is never set. java.lang.ExceptionInInitializerError at org.eclipse.linuxtools.internal.oprofile.launch.configuration.OprofileCounter.getCounters(OprofileCounter.java:64) at org.eclipse.linuxtools.internal.oprofile.launch.configuration.OprofileEventConfigTab.<init>(OprofileEventConfigTab.java:68) at org.eclipse.linuxtools.internal.oprofile.launch.configuration.OprofileLaunchConfigurationTabGroup.getProfileTabs(OprofileLaunchConfigurationTabGroup.java:19) at org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup.createTabs(ProfileLaunchConfigurationTabGroup.java:32) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.createTabs(LaunchConfigurationTabGroupWrapper.java:137) at org.eclipse.debug.internal.ui.launchConfigurations.CreateLaunchConfigurationAction.performAction(CreateLaunchConfigurationAction.java:72) at org.eclipse.debug.internal.ui.launchConfigurations.AbstractLaunchConfigurationAction$1.run(AbstractLaunchConfigurationAction.java:103) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.debug.internal.ui.launchConfigurations.AbstractLaunchConfigurationAction.run(AbstractLaunchConfigurationAction.java:106) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$1.run(LaunchConfigurationsDialog.java:531) at org.eclipse.debug.ui.AbstractDebugView.doubleClick(AbstractDebugView.java:731) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:845) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:843) at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1462) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1246) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:246) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:307) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1132) at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:579) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:587) at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:521) at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:81) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061) at org.eclipse.jface.action.ActionContributionItem$9.handleEvent(ActionContributionItem.java:1284) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Caused by: java.lang.NullPointerException at org.eclipse.linuxtools.tools.launch.core.factory.RuntimeProcessFactory.exec(RuntimeProcessFactory.java:129) at org.eclipse.linuxtools.tools.launch.core.factory.RuntimeProcessFactory.exec(RuntimeProcessFactory.java:116) at org.eclipse.linuxtools.tools.launch.core.factory.RuntimeProcessFactory.exec(RuntimeProcessFactory.java:99) at org.eclipse.linuxtools.internal.oprofile.core.opxml.info.InfoAdapter.<init>(InfoAdapter.java:97) at org.eclipse.linuxtools.internal.oprofile.core.linux.OpxmlRunner.run(OpxmlRunner.java:117) at org.eclipse.linuxtools.internal.oprofile.core.linux.LinuxOpxmlProvider$OpInfoRunner.run(LinuxOpxmlProvider.java:55) at org.eclipse.linuxtools.internal.oprofile.core.linux.LinuxOpxmlProvider$OpInfoRunner.run0(LinuxOpxmlProvider.java:46) at org.eclipse.linuxtools.internal.oprofile.core.daemon.OpInfo.getInfo(OpInfo.java:84) at org.eclipse.linuxtools.internal.oprofile.core.Oprofile.initializeOprofileCore(Oprofile.java:97) at org.eclipse.linuxtools.internal.oprofile.core.Oprofile.initializeOprofileModule(Oprofile.java:66) at org.eclipse.linuxtools.internal.oprofile.core.Oprofile.<clinit>(Oprofile.java:45) ... 68 more (In reply to comment #7) > This would be an API-breaking change wouldn't it ? > (https://hudson.eclipse.org/hudson/job/linuxtools-master/javadoc/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.html) > ? I guess we could deprecate it the old ones and have the new methods as well. Yep. I'll do it. > > Also, I seem to be getting an error : i'll take a look at that too. Thanks Created attachment 217547 [details]
tools.launch: Using proxies instead of local files
This last patch doesn't break the api and works fine for project == null scenarios. If there is no information about the remote location it will run it using a local proxy. Can you test it to see if your problems were fixed? I found another problem that appears with this patch. The local proxy is not returning the output of a command correctly. This happens in local valgrind launch. Working on fixing that before applying this one. There is a problem in the way valgrind was using a process. We are now using cdt classes to launch a local process and for some reason we need to get the inputStream before running the waitFor method. I added a patch to fix this issue. Created attachment 217562 [details]
valgrind: Get inputStream before calling waitFor method
This looks good to me, and fixed the errors. Since this is an API addition compared to 1.0 for org.eclipse.linuxtools.tools.launch.core, please make sure to bump up the plugin's version to 1.1.0 (in the MANIFEST and the pom), as well as to document under which version the newly added API will apear (ie. @since 1.1). Created attachment 217688 [details]
tools.launch: Using proxies instead of local files
Created attachment 217689 [details]
Finally a last version
This patch is EPL. I wrote 100% of it myself. I had permission from my employer (IBM Corp.) to do so. Commited. Commits: 0f23fc93122eb3a061ef09129c7b7e6fd733422d and eded395b6290263fdd1afc669db4617c76a9d7a7 |