Initial changes for developing a common remote plugin
cover Initial changes for developing a common remote plugin
- create a separate plugin in which to drop all tools needed for remote support
- will leave it empty until all functionalilty is properly separated & the util remote code is clearly distinguised
- code refactoring for remote tools plugin in order to simplify code and create single point of control over commands stages
[Yocto #4362]
Ioana Grigoropol (4):
Initial commit for remote separate plugin Refactor Model(s) to display customized messages Unify preProcess for all commands models
Add default behaviour for commands for post processing
plugins/org.yocto.remote.utils/.classpath | 7 ++ plugins/org.yocto.remote.utils/.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../org.yocto.remote.utils/META-INF/MANIFEST.MF | 10 +++ plugins/org.yocto.remote.utils/build.properties | 4 + .../src/org/yocto/remote/utils/Activator.java | 50 +++++++++++ .../yocto/sdk/remotetools/actions/BaseModel.java | 89 +++++++++++++------- .../sdk/remotetools/actions/OprofileModel.java | 53 ++++-------- .../sdk/remotetools/actions/PowertopModel.java | 47 ++++------- .../sdk/remotetools/actions/SystemtapModel.java | 34 ++++---- .../yocto/sdk/remotetools/actions/Ust2Model.java | 63 ++++---------- .../sdk/remotetools/actions/UstModelLegacy.java | 54 ++++-------- 12 files changed, 243 insertions(+), 203 deletions(-) create mode 100644 plugins/org.yocto.remote.utils/.classpath create mode 100644 plugins/org.yocto.remote.utils/.project create mode 100644 plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF create mode 100644 plugins/org.yocto.remote.utils/build.properties create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java
Signature · 1 line
1.7.9.5
PATCH 1/4 Initial commit for remote separate plugin
--- plugins/org.yocto.remote.utils/.classpath | 7 +++ plugins/org.yocto.remote.utils/.project | 28 +++++++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 +++ .../org.yocto.remote.utils/META-INF/MANIFEST.MF | 10 ++++ plugins/org.yocto.remote.utils/build.properties | 4 ++ .../src/org/yocto/remote/utils/Activator.java | 50 ++++++++++++++++++++ 6 files changed, 106 insertions(+) create mode 100644 plugins/org.yocto.remote.utils/.classpath create mode 100644 plugins/org.yocto.remote.utils/.project create mode 100644 plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF create mode 100644 plugins/org.yocto.remote.utils/build.properties create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java
plugins/org.yocto.remote.utils/.classpath new file +7 -0
@@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath>
plugins/org.yocto.remote.utils/.project new file +28 -0
@@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.yocto.remote.utils</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription>
plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs new file +7 -0
@@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6
plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF new file +10 -0
@@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Yocto Remote Utils +Bundle-SymbolicName: org.yocto.remote +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.yocto.remote.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6
plugins/org.yocto.remote.utils/build.properties new file +4 -0
@@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .
plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 2/4 Refactor Model(s) to display customized messages
In reply to Ioana Grigoropol- added new subtask for each of the models offered by YP for Remote Tools
--- .../yocto/sdk/remotetools/actions/BaseModel.java | 70 ++++++++++++-------- .../sdk/remotetools/actions/OprofileModel.java | 15 +++-- .../sdk/remotetools/actions/PowertopModel.java | 13 ++-- .../sdk/remotetools/actions/SystemtapModel.java | 7 +- .../yocto/sdk/remotetools/actions/Ust2Model.java | 10 +-- .../sdk/remotetools/actions/UstModelLegacy.java | 10 +-- 6 files changed, 76 insertions(+), 49 deletions(-)
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/BaseModel.java +42 -28
@@ -18,49 +18,63 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.rse.core.model.IHost; abstract public class BaseModel implements IRunnableWithProgress { - - protected IHost rseConnection; + protected IHost host; + protected String taskName; + + private static final int WORKLOAD = 100; + + private static final int INIT_PERCENT = 5; + private static final int PRE_PROCESS_PERCENT = 30; + private static final int PROCESS_PERCENT = 30; + private static final int POST_PROCESS_PERCENT = 30; + private static final int CLEAN_PERCENT = 5; + + private static final String RUN_MSG = "Running task: "; + private static final String INIT_MSG = "Initializing "; + private static final String PRE_PROCESS_MSG = "Preparing "; + private static final String PROCESS_MSG = "Processing "; + private static final String POST_PROCESS_MSG = "Finishing "; + private static final String CLEAN_MSG = "Cleaning "; + private static final String DOTS = "..."; abstract public void preProcess(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException; abstract public void postProcess(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException; abstract public void process(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException; - public BaseModel(IHost rseConnection) { - this.rseConnection=rseConnection; + BaseModel(IHost host, String taskName) { + this.host = host; + this.taskName = taskName; } - protected void init(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - /* - if(rseConnection==null) { - throw new InvocationTargetException(new Exception("NULL rse connection"),"NULL rse connection"); - }*/ } - protected void uninit(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - + protected void clean(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { } - + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { - monitor.beginTask("", 100); - init(new SubProgressMonitor(monitor,5)); - if(monitor.isCanceled()) - throw new InterruptedException("User canncelled"); - preProcess(new SubProgressMonitor(monitor,30)); - if(monitor.isCanceled()) - throw new InterruptedException("User canncelled"); - process(new SubProgressMonitor(monitor,30)); - if(monitor.isCanceled()) - throw new InterruptedException("User canncelled"); - postProcess(new SubProgressMonitor(monitor,30)); - }catch (InterruptedException e){ - throw e; - }catch (InvocationTargetException e) { + monitor.beginTask(RUN_MSG + taskName, WORKLOAD); + + monitor.subTask(INIT_MSG + taskName + DOTS); + init(new SubProgressMonitor(monitor, INIT_PERCENT)); + + monitor.subTask(PRE_PROCESS_MSG + taskName + DOTS); + preProcess(new SubProgressMonitor(monitor, PRE_PROCESS_PERCENT)); + + monitor.subTask(PROCESS_MSG + taskName + DOTS); + process(new SubProgressMonitor(monitor, PROCESS_PERCENT)); + + monitor.subTask(POST_PROCESS_MSG + taskName + DOTS); + postProcess(new SubProgressMonitor(monitor, POST_PROCESS_PERCENT)); + } catch (InterruptedException e){ + throw new InterruptedException("User cancelled!"); + } catch (InvocationTargetException e) { throw e; - }finally { - uninit(new SubProgressMonitor(monitor,5)); + } finally { + monitor.subTask(CLEAN_MSG + taskName + DOTS); + clean(new SubProgressMonitor(monitor, CLEAN_PERCENT)); monitor.done(); } }
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/OprofileModel.java +9 -6
@@ -36,18 +36,21 @@ public class OprofileModel extends BaseModel { static final private String LOCAL_SCRIPT="resources/yocto_tool.sh"; static final private String LOCAL_EXEC="oprofile-viewer"; + private static final String TASK_NAME = "oprofile command"; + private IWorkbenchWindow window; public OprofileModel(IHost host, IWorkbenchWindow window) { - super(host); + super(host, TASK_NAME); this.window=window; } + @Override public void preProcess(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { //upload script to remote try { RSEHelper.putRemoteFileInPlugin( - rseConnection, + host, LOCAL_SCRIPT, REMOTE_EXEC, monitor);
@@ -68,7 +71,7 @@ public class OprofileModel extends BaseModel { private void startServer(IProgressMonitor monitor) throws Exception { int exit_code; - RemoteApplication app=new RemoteApplication(rseConnection,null,REMOTE_EXEC,null); + RemoteApplication app=new RemoteApplication(host,null,REMOTE_EXEC,null); String args="start -d oprofile-server"; try {
@@ -89,7 +92,7 @@ public class OprofileModel extends BaseModel { private void stopServer(IProgressMonitor monitor) throws Exception { - RemoteApplication app=new RemoteApplication(rseConnection,null,REMOTE_EXEC,null); + RemoteApplication app=new RemoteApplication(host,null,REMOTE_EXEC,null); String args="stop -d oprofile-server"; try { monitor.beginTask("Stopping oprofile-server", 2);
@@ -177,8 +180,8 @@ public class OprofileModel extends BaseModel { new LocalJob("oprofile-viewer", (searchPath!=null) ? - new String[] {LOCAL_EXEC,"-h",rseConnection.getHostName(),"-s",searchPath} : - new String[] {LOCAL_EXEC,"-h",rseConnection.getHostName()}, + new String[] {LOCAL_EXEC,"-h",host.getHostName(),"-s",searchPath} : + new String[] {LOCAL_EXEC,"-h",host.getHostName()}, null, null, window).schedule();
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/PowertopModel.java +8 -5
@@ -33,15 +33,18 @@ public class PowertopModel extends BaseModel { final private String LOCAL_SCRIPT="resources/yocto_tool.sh"; final private String REMOTE_FILE_PREFIX="/tmp/yocto-powertop-"; final private String LOCAL_FILE_SUFFIX=".local"; + + private static final String TASK_NAME = "powertop command"; + private Float time; private boolean showpid; Display display; - + String localfile; String remotefile; public PowertopModel(IHost host, Float time,boolean showpid,Display display) { - super(host); + super(host, TASK_NAME); this.time=time; this.showpid=showpid; this.display=display;
@@ -53,7 +56,7 @@ public class PowertopModel extends BaseModel { //upload script to remote try { RSEHelper.putRemoteFileInPlugin( - rseConnection, + host, LOCAL_SCRIPT, REMOTE_EXEC, monitor);
@@ -79,7 +82,7 @@ public class PowertopModel extends BaseModel { private void generateData(IProgressMonitor monitor) throws Exception { int exit_code; - RemoteApplication app=new RemoteApplication(rseConnection,null,REMOTE_EXEC,null); + RemoteApplication app=new RemoteApplication(host,null,REMOTE_EXEC,null); String currentDate=new SimpleDateFormat("yyyyMMddHHmmssSSS").format(Calendar.getInstance().getTime()).toString(); remotefile=new String(REMOTE_FILE_PREFIX + currentDate); localfile=new String(remotefile + LOCAL_FILE_SUFFIX);
@@ -117,7 +120,7 @@ public class PowertopModel extends BaseModel { private void getDataFile(IProgressMonitor monitor) throws Exception { RSEHelper.getRemoteFile( - rseConnection, + host, localfile, remotefile, monitor);
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapModel.java +5 -2
@@ -24,17 +24,20 @@ import org.yocto.sdk.remotetools.ShellSession; public class SystemtapModel extends BaseModel { protected static final String DEFAULT_INIT_SCRIPT = "oe-init-build-env"; protected static final String SYSTEMTAP_CONSOLE = "Systemtap Console"; + + private static final String TASK_NAME = "systemtap command"; + protected MessageConsole sessionConsole; private String metadata_location; private String remote_host; private String user_id; private String systemtap_script; private String systemtap_args; - + Display display; public SystemtapModel(String metadata_location, String remote_host, String user_id, String systemtap_script, String systemtap_args, Display display) { - super(null); + super(null, TASK_NAME); this.metadata_location=metadata_location; this.remote_host=remote_host; this.user_id=user_id;
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/Ust2Model.java +6 -4
@@ -40,6 +40,8 @@ public class Ust2Model extends BaseModel { static final private String LOCAL_EXEC="lttv-gui"; public static final String TRACE_FOLDER_NAME = "Traces"; static final private String DATAFILE_PREFIX = "ustfile:"; + + private static final String TASK_NAME = "ust2trace command"; private String trace_loc;
@@ -50,7 +52,7 @@ public class Ust2Model extends BaseModel { private IWorkbenchWindow window; public Ust2Model(IHost host, String trace, String project, IWorkbenchWindow window) { - super(host); + super(host, TASK_NAME); trace_loc=trace; prj_name = project;
@@ -63,7 +65,7 @@ public class Ust2Model extends BaseModel { ///upload script to remote try { RSEHelper.putRemoteFileInPlugin( - rseConnection, + host, LOCAL_SCRIPT, REMOTE_EXEC, monitor);
@@ -91,7 +93,7 @@ public class Ust2Model extends BaseModel { private String generateData(IProgressMonitor monitor) throws Exception { int exit_code; - RemoteApplication app=new RemoteApplication(rseConnection,null,REMOTE_EXEC,null); + RemoteApplication app=new RemoteApplication(host,null,REMOTE_EXEC,null); String remoteDataFile=null;
@@ -131,7 +133,7 @@ public class Ust2Model extends BaseModel { localfile=new String(datafile.substring(0,datafile.length()-4) + LOCAL_FILE_SUFFIX); RSEHelper.getRemoteFile( - rseConnection, + host, localfile, datafile, monitor);
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/UstModelLegacy.java +6 -4
@@ -42,6 +42,8 @@ public class UstModelLegacy extends BaseModel { static final private String LOCAL_EXEC="lttv-gui"; public static final String TRACE_FOLDER_NAME = "Traces"; static final private String DATAFILE_PREFIX = "ustfile:"; + + private static final String TASK_NAME = "usttrace command"; private String argument; private String application;
@@ -52,7 +54,7 @@ public class UstModelLegacy extends BaseModel { private IWorkbenchWindow window; public UstModelLegacy(IHost host, String app,String arg, String project, IWorkbenchWindow window) { - super(host); + super(host, TASK_NAME); application=app; argument=arg; prj_name = project;
@@ -65,7 +67,7 @@ public class UstModelLegacy extends BaseModel { ///upload script to remote try { RSEHelper.putRemoteFileInPlugin( - rseConnection, + host, LOCAL_SCRIPT, REMOTE_EXEC, monitor);
@@ -93,7 +95,7 @@ public class UstModelLegacy extends BaseModel { private String generateData(IProgressMonitor monitor) throws Exception { int exit_code; - RemoteApplication app=new RemoteApplication(rseConnection,null,REMOTE_EXEC,null); + RemoteApplication app=new RemoteApplication(host,null,REMOTE_EXEC,null); String tempArgs=new String(); if(application!=null) tempArgs=tempArgs.concat(application + " ");
@@ -137,7 +139,7 @@ public class UstModelLegacy extends BaseModel { localfile=new String(datafile.substring(0,datafile.length()-4) + LOCAL_FILE_SUFFIX); RSEHelper.getRemoteFile( - rseConnection, + host, localfile, datafile, monitor);
Signature · 1 line
1.7.9.5
PATCH 3/4 Unify preProcess for all commands models
In reply to Ioana Grigoropol--- .../yocto/sdk/remotetools/actions/BaseModel.java | 22 +++++++-- .../sdk/remotetools/actions/OprofileModel.java | 42 +++++------------ .../sdk/remotetools/actions/PowertopModel.java | 39 +++++----------- .../sdk/remotetools/actions/SystemtapModel.java | 30 ++++++------- .../yocto/sdk/remotetools/actions/Ust2Model.java | 47 ++++++-------------- .../sdk/remotetools/actions/UstModelLegacy.java | 44 +++++------------- 6 files changed, 79 insertions(+), 145 deletions(-)
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/BaseModel.java +19 -3
@@ -16,11 +16,14 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.rse.core.model.IHost; +import org.yocto.sdk.remotetools.RSEHelper; abstract public class BaseModel implements IRunnableWithProgress { protected IHost host; protected String taskName; - + protected String localScript; + protected String remoteExec; + private static final int WORKLOAD = 100; private static final int INIT_PERCENT = 5;
@@ -37,13 +40,26 @@ abstract public class BaseModel implements IRunnableWithProgress { private static final String CLEAN_MSG = "Cleaning "; private static final String DOTS = "..."; - abstract public void preProcess(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException; + public void preProcess(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException{ + //upload script to remote + try { + RSEHelper.putRemoteFileInPlugin(host, localScript, remoteExec, monitor); + }catch (InterruptedException e){ + throw e; + }catch (InvocationTargetException e) { + throw e; + }catch (Exception e) { + throw new InvocationTargetException(e, e.getMessage()); + } + } abstract public void postProcess(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException; abstract public void process(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException; - BaseModel(IHost host, String taskName) { + BaseModel(IHost host, String taskName, String localScript, String remoteExec) { this.host = host; this.taskName = taskName; + this.localScript = localScript; + this.remoteExec = remoteExec; } protected void init(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { }
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/OprofileModel.java +11 -31
75 lines not on this page · raw message
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/PowertopModel.java +10 -29
@@ -29,10 +29,11 @@ import org.yocto.sdk.remotetools.views.BaseFileView; public class PowertopModel extends BaseModel { - final private String REMOTE_EXEC="/tmp/yocto_tool.sh"; - final private String LOCAL_SCRIPT="resources/yocto_tool.sh"; - final private String REMOTE_FILE_PREFIX="/tmp/yocto-powertop-"; - final private String LOCAL_FILE_SUFFIX=".local"; + private static final String REMOTE_EXEC = "/tmp/yocto_tool.sh"; + private static final String LOCAL_SCRIPT = "resources/yocto_tool.sh"; + + final private String REMOTE_FILE_PREFIX = "/tmp/yocto-powertop-"; + final private String LOCAL_FILE_SUFFIX = ".local"; private static final String TASK_NAME = "powertop command";
@@ -44,31 +45,11 @@ public class PowertopModel extends BaseModel { String remotefile; public PowertopModel(IHost host, Float time,boolean showpid,Display display) { - super(host, TASK_NAME); + super(host, TASK_NAME, LOCAL_SCRIPT, REMOTE_EXEC); this.time=time; this.showpid=showpid; this.display=display; } - - @Override - public void preProcess(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - //upload script to remote - try { - RSEHelper.putRemoteFileInPlugin( - host, - LOCAL_SCRIPT, - REMOTE_EXEC, - monitor); - }catch (InterruptedException e){ - throw e; - }catch (InvocationTargetException e) { - throw e; - }catch (Exception e) { - throw new InvocationTargetException(e,e.getMessage()); - } - - } @Override public void postProcess(IProgressMonitor monitor)
@@ -82,13 +63,13 @@ public class PowertopModel extends BaseModel { private void generateData(IProgressMonitor monitor) throws Exception { int exit_code; - RemoteApplication app=new RemoteApplication(host,null,REMOTE_EXEC,null); + RemoteApplication app = new RemoteApplication(host, null, remoteExec, null); String currentDate=new SimpleDateFormat("yyyyMMddHHmmssSSS").format(Calendar.getInstance().getTime()).toString(); - remotefile=new String(REMOTE_FILE_PREFIX + currentDate); - localfile=new String(remotefile + LOCAL_FILE_SUFFIX); + remotefile = new String(REMOTE_FILE_PREFIX + currentDate); + localfile = new String(remotefile + LOCAL_FILE_SUFFIX); ArrayList <String> param= new ArrayList <String>(); - param.add(REMOTE_EXEC); + param.add(remoteExec); param.add("start"); param.add("-l"); param.add(remotefile);
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapModel.java +14 -16
@@ -37,13 +37,13 @@ public class SystemtapModel extends BaseModel { Display display; public SystemtapModel(String metadata_location, String remote_host, String user_id, String systemtap_script, String systemtap_args, Display display) { - super(null, TASK_NAME); - this.metadata_location=metadata_location; - this.remote_host=remote_host; - this.user_id=user_id; - this.systemtap_script=systemtap_script; + super(null, TASK_NAME, "", ""); + this.metadata_location = metadata_location; + this.remote_host = remote_host; + this.user_id = user_id; + this.systemtap_script = systemtap_script; this.systemtap_args = systemtap_args; - this.display=display; + this.display = display; if (sessionConsole == null) { IConsoleManager conMan = ConsolePlugin.getDefault().getConsoleManager(); IConsole[] existing = conMan.getConsoles();
@@ -62,13 +62,12 @@ public class SystemtapModel extends BaseModel { } @Override - - public void preProcess(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - } + public void preProcess(IProgressMonitor monitor) + throws InvocationTargetException, InterruptedException {} - public void process(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { + @Override + public void process(IProgressMonitor monitor) + throws InvocationTargetException, InterruptedException { try { ShellSession shell = new ShellSession(ShellSession.SHELL_TYPE_BASH, new File(this.metadata_location),
@@ -85,9 +84,8 @@ public class SystemtapModel extends BaseModel { } } - - public void postProcess(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - } + @Override + public void postProcess(IProgressMonitor monitor) + throws InvocationTargetException, InterruptedException {} }
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/Ust2Model.java +13 -34
79 lines not on this page · raw message
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/UstModelLegacy.java +12 -32
64 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 4/4 Add default behaviour for commands for post processing Signed-off-by: Ioana Grigoropol <[email protected]>
In reply to Ioana Grigoropol--- .../yocto/sdk/remotetools/actions/BaseModel.java | 3 ++- .../sdk/remotetools/actions/OprofileModel.java | 6 ------ .../sdk/remotetools/actions/PowertopModel.java | 1 - .../sdk/remotetools/actions/SystemtapModel.java | 5 ----- .../yocto/sdk/remotetools/actions/Ust2Model.java | 12 ------------ .../sdk/remotetools/actions/UstModelLegacy.java | 6 +----- 6 files changed, 3 insertions(+), 30 deletions(-)
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/BaseModel.java +2 -1
@@ -52,7 +52,8 @@ abstract public class BaseModel implements IRunnableWithProgress { throw new InvocationTargetException(e, e.getMessage()); } } - abstract public void postProcess(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException; + public void postProcess(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException{} + abstract public void process(IProgressMonitor monitor) throws InvocationTargetException,InterruptedException; BaseModel(IHost host, String taskName, String localScript, String remoteExec) {
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/OprofileModel.java +0 -6
@@ -42,12 +42,6 @@ public class OprofileModel extends BaseModel { super(host, TASK_NAME, LOCAL_SCRIPT, REMOTE_EXEC); this.window = window; } - - @Override - public void postProcess(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - - } private void startServer(IProgressMonitor monitor) throws Exception { int exit_code;
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/PowertopModel.java +0 -1
@@ -57,7 +57,6 @@ public class PowertopModel extends BaseModel { try { new File(localfile).delete(); }catch (Exception e) { - } }
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapModel.java +0 -5
@@ -83,9 +83,4 @@ public class SystemtapModel extends BaseModel { throw new InvocationTargetException(e,e.getMessage()); } } - - @Override - public void postProcess(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException {} - }
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/Ust2Model.java +0 -12
@@ -57,18 +57,6 @@ public class Ust2Model extends BaseModel { prj_name = project; this.window = window; } - - @Override - public void postProcess(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - try { - //new File(localfile).delete(); - //NOT delete the directory since lttv-gui is running asynchronously - //new File(localfile.substring(0,localfile.length()-LOCAL_FILE_SUFFIX.length())).delete(); - }catch (Exception e) { - - } - } private String generateData(IProgressMonitor monitor) throws Exception { int exit_code;
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/UstModelLegacy.java +1 -5
@@ -20,13 +20,12 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.core.runtime.IPath; import org.eclipse.rse.core.model.IHost; import org.eclipse.ui.IWorkbenchWindow; - import org.yocto.sdk.remotetools.CommonHelper; import org.yocto.sdk.remotetools.Messages; import org.yocto.sdk.remotetools.RSEHelper;
@@ -66,10 +65,7 @@ public class UstModelLegacy extends BaseModel { throws InvocationTargetException, InterruptedException { try { new File(localfile).delete(); - //NOT delete the directory since lttv-gui is running asynchronously - //new File(localfile.substring(0,localfile.length()-LOCAL_FILE_SUFFIX.length())).delete(); }catch (Exception e) { - } }
Signature · 1 line
1.7.9.5
Hi Ioana,
I thought we're going to create a common remote util plugin first then modify the remotetools and bc.ui to use this new remote util plugin. From your patch series, the 1st path seems you're doing that but the following 3 you are making changes to remote tools files. I'd like us to focus on creating this common util first then switch to modify the other plug-ins by using this common util. I'd expect this common util will contain classes that host all the functions that currently exist in RemoteHelper.java in bc.ui jzhang/windows-build and RSEHelper.java in remotetools. There are many duplicate codes in these classes that we should abstract them out to put in this common util plug-in. Does this make sense?
Also, please add License header in new files if you are going to introduce any.
Thanks,
Jessica
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ioana Grigoropol
Sent: Friday, April 26, 2013 7:32 AM
To: [email protected]
Subject: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
- create a separate plugin in which to drop all tools needed for remote support
- will leave it empty until all functionalilty is properly separated & the util remote code is clearly distinguised
- code refactoring for remote tools plugin in order to simplify code and create single point of control over commands stages
[Yocto #4362]
Ioana Grigoropol (4):
Initial commit for remote separate plugin Refactor Model(s) to display customized messages Unify preProcess for all commands models
Add default behaviour for commands for post processing
plugins/org.yocto.remote.utils/.classpath | 7 ++ plugins/org.yocto.remote.utils/.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../org.yocto.remote.utils/META-INF/MANIFEST.MF | 10 +++ plugins/org.yocto.remote.utils/build.properties | 4 + .../src/org/yocto/remote/utils/Activator.java | 50 +++++++++++ .../yocto/sdk/remotetools/actions/BaseModel.java | 89 +++++++++++++------- .../sdk/remotetools/actions/OprofileModel.java | 53 ++++-------- .../sdk/remotetools/actions/PowertopModel.java | 47 ++++------- .../sdk/remotetools/actions/SystemtapModel.java | 34 ++++---- .../yocto/sdk/remotetools/actions/Ust2Model.java | 63 ++++---------- .../sdk/remotetools/actions/UstModelLegacy.java | 54 ++++-------- 12 files changed, 243 insertions(+), 203 deletions(-) create mode 100644 plugins/org.yocto.remote.utils/.classpath create mode 100644 plugins/org.yocto.remote.utils/.project create mode 100644 plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF create mode 100644 plugins/org.yocto.remote.utils/build.properties create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java
--
1.7.9.5
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Hi Jessica,
Yes it makes sense.
The reason why I started refactoring the code in the remote tools is to try and isolate the functionality we need to move to the separate plugin. Instead of moving everything in the first place, I am trying to reduce the code to single points of control without modifying the actual functionalities of the Helpers. I can do the refactoring the other way around, but I think this way is cleaner because I would be clear what we need to keep in the helpers and what to drop.
Thanks,
Ioana
-----Original Message-----
From: Zhang, Jessica
Sent: Friday, April 26, 2013 9:31 PM
To: Grigoropol, IoanaX; [email protected]
Subject: RE: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
Hi Ioana,
I thought we're going to create a common remote util plugin first then modify the remotetools and bc.ui to use this new remote util plugin. From your patch series, the 1st path seems you're doing that but the following 3 you are making changes to remote tools files. I'd like us to focus on creating this common util first then switch to modify the other plug-ins by using this common util. I'd expect this common util will contain classes that host all the functions that currently exist in RemoteHelper.java in bc.ui jzhang/windows-build and RSEHelper.java in remotetools. There are many duplicate codes in these classes that we should abstract them out to put in this common util plug-in. Does this make sense?
Also, please add License header in new files if you are going to introduce any.
Thanks,
Jessica
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ioana Grigoropol
Sent: Friday, April 26, 2013 7:32 AM
To: [email protected]
Subject: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
- create a separate plugin in which to drop all tools needed for remote support
- will leave it empty until all functionalilty is properly separated & the util remote code is clearly distinguised
- code refactoring for remote tools plugin in order to simplify code and create single point of control over commands stages
[Yocto #4362]
Ioana Grigoropol (4):
Initial commit for remote separate plugin Refactor Model(s) to display customized messages Unify preProcess for all commands models
Add default behaviour for commands for post processing
plugins/org.yocto.remote.utils/.classpath | 7 ++ plugins/org.yocto.remote.utils/.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../org.yocto.remote.utils/META-INF/MANIFEST.MF | 10 +++ plugins/org.yocto.remote.utils/build.properties | 4 + .../src/org/yocto/remote/utils/Activator.java | 50 +++++++++++ .../yocto/sdk/remotetools/actions/BaseModel.java | 89 +++++++++++++------- .../sdk/remotetools/actions/OprofileModel.java | 53 ++++-------- .../sdk/remotetools/actions/PowertopModel.java | 47 ++++------- .../sdk/remotetools/actions/SystemtapModel.java | 34 ++++---- .../yocto/sdk/remotetools/actions/Ust2Model.java | 63 ++++---------- .../sdk/remotetools/actions/UstModelLegacy.java | 54 ++++-------- 12 files changed, 243 insertions(+), 203 deletions(-) create mode 100644 plugins/org.yocto.remote.utils/.classpath create mode 100644 plugins/org.yocto.remote.utils/.project create mode 100644 plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF create mode 100644 plugins/org.yocto.remote.utils/build.properties create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java
--
1.7.9.5
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Hi Ioana,
OK, then can you resend the patch set and drop the first patch so that the patch set is clearer on what they're meant to be? E.g. in this case, cleanup the remote tools function usage. Btw, will the 3 patches all you'll need for cleanup or there'll be more? If there'll be more, probably send them all at the same time.
The other thing is your patches, each one only has a very brief commit subject, can you add a little bit more in the commit content for the change context or purpose?
Thanks,
Jessica
-----Original Message-----
From: Grigoropol, IoanaX
Sent: Saturday, April 27, 2013 1:40 AM
To: Zhang, Jessica; [email protected]
Subject: RE: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
Hi Jessica,
Yes it makes sense.
The reason why I started refactoring the code in the remote tools is to try and isolate the functionality we need to move to the separate plugin. Instead of moving everything in the first place, I am trying to reduce the code to single points of control without modifying the actual functionalities of the Helpers. I can do the refactoring the other way around, but I think this way is cleaner because I would be clear what we need to keep in the helpers and what to drop.
Thanks,
Ioana
-----Original Message-----
From: Zhang, Jessica
Sent: Friday, April 26, 2013 9:31 PM
To: Grigoropol, IoanaX; [email protected]
Subject: RE: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
Hi Ioana,
I thought we're going to create a common remote util plugin first then modify the remotetools and bc.ui to use this new remote util plugin. From your patch series, the 1st path seems you're doing that but the following 3 you are making changes to remote tools files. I'd like us to focus on creating this common util first then switch to modify the other plug-ins by using this common util. I'd expect this common util will contain classes that host all the functions that currently exist in RemoteHelper.java in bc.ui jzhang/windows-build and RSEHelper.java in remotetools. There are many duplicate codes in these classes that we should abstract them out to put in this common util plug-in. Does this make sense?
Also, please add License header in new files if you are going to introduce any.
Thanks,
Jessica
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ioana Grigoropol
Sent: Friday, April 26, 2013 7:32 AM
To: [email protected]
Subject: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
- create a separate plugin in which to drop all tools needed for remote support
- will leave it empty until all functionalilty is properly separated & the util remote code is clearly distinguised
- code refactoring for remote tools plugin in order to simplify code and create single point of control over commands stages
[Yocto #4362]
Ioana Grigoropol (4):
Initial commit for remote separate plugin Refactor Model(s) to display customized messages Unify preProcess for all commands models
Add default behaviour for commands for post processing
plugins/org.yocto.remote.utils/.classpath | 7 ++ plugins/org.yocto.remote.utils/.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../org.yocto.remote.utils/META-INF/MANIFEST.MF | 10 +++ plugins/org.yocto.remote.utils/build.properties | 4 + .../src/org/yocto/remote/utils/Activator.java | 50 +++++++++++ .../yocto/sdk/remotetools/actions/BaseModel.java | 89 +++++++++++++------- .../sdk/remotetools/actions/OprofileModel.java | 53 ++++-------- .../sdk/remotetools/actions/PowertopModel.java | 47 ++++------- .../sdk/remotetools/actions/SystemtapModel.java | 34 ++++---- .../yocto/sdk/remotetools/actions/Ust2Model.java | 63 ++++---------- .../sdk/remotetools/actions/UstModelLegacy.java | 54 ++++-------- 12 files changed, 243 insertions(+), 203 deletions(-) create mode 100644 plugins/org.yocto.remote.utils/.classpath create mode 100644 plugins/org.yocto.remote.utils/.project create mode 100644 plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF create mode 100644 plugins/org.yocto.remote.utils/build.properties create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java
--
1.7.9.5
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Hi Jessica,
I will resent the refactoring patches for the remote tools plugin since there will be more than three and I will postpone the first one for after the refactoring.
Thanks,
Ioana
________________________________________
From: Zhang, Jessica
Sent: Saturday, April 27, 2013 11:06 PM
To: Grigoropol, IoanaX; [email protected]
Subject: RE: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
Hi Ioana,
OK, then can you resend the patch set and drop the first patch so that the patch set is clearer on what they're meant to be? E.g. in this case, cleanup the remote tools function usage. Btw, will the 3 patches all you'll need for cleanup or there'll be more? If there'll be more, probably send them all at the same time.
The other thing is your patches, each one only has a very brief commit subject, can you add a little bit more in the commit content for the change context or purpose?
Thanks,
Jessica
-----Original Message-----
From: Grigoropol, IoanaX
Sent: Saturday, April 27, 2013 1:40 AM
To: Zhang, Jessica; [email protected]
Subject: RE: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
Hi Jessica,
Yes it makes sense.
The reason why I started refactoring the code in the remote tools is to try and isolate the functionality we need to move to the separate plugin. Instead of moving everything in the first place, I am trying to reduce the code to single points of control without modifying the actual functionalities of the Helpers. I can do the refactoring the other way around, but I think this way is cleaner because I would be clear what we need to keep in the helpers and what to drop.
Thanks,
Ioana
-----Original Message-----
From: Zhang, Jessica
Sent: Friday, April 26, 2013 9:31 PM
To: Grigoropol, IoanaX; [email protected]
Subject: RE: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
Hi Ioana,
I thought we're going to create a common remote util plugin first then modify the remotetools and bc.ui to use this new remote util plugin. From your patch series, the 1st path seems you're doing that but the following 3 you are making changes to remote tools files. I'd like us to focus on creating this common util first then switch to modify the other plug-ins by using this common util. I'd expect this common util will contain classes that host all the functions that currently exist in RemoteHelper.java in bc.ui jzhang/windows-build and RSEHelper.java in remotetools. There are many duplicate codes in these classes that we should abstract them out to put in this common util plug-in. Does this make sense?
Also, please add License header in new files if you are going to introduce any.
Thanks,
Jessica
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ioana Grigoropol
Sent: Friday, April 26, 2013 7:32 AM
To: [email protected]
Subject: [yocto] [PATCH 0/4] Initial changes for developing a common remote plugin
- create a separate plugin in which to drop all tools needed for remote support
- will leave it empty until all functionalilty is properly separated & the util remote code is clearly distinguised
- code refactoring for remote tools plugin in order to simplify code and create single point of control over commands stages
[Yocto #4362]
Ioana Grigoropol (4):
Initial commit for remote separate plugin Refactor Model(s) to display customized messages Unify preProcess for all commands models
Add default behaviour for commands for post processing
plugins/org.yocto.remote.utils/.classpath | 7 ++ plugins/org.yocto.remote.utils/.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../org.yocto.remote.utils/META-INF/MANIFEST.MF | 10 +++ plugins/org.yocto.remote.utils/build.properties | 4 + .../src/org/yocto/remote/utils/Activator.java | 50 +++++++++++ .../yocto/sdk/remotetools/actions/BaseModel.java | 89 +++++++++++++------- .../sdk/remotetools/actions/OprofileModel.java | 53 ++++-------- .../sdk/remotetools/actions/PowertopModel.java | 47 ++++------- .../sdk/remotetools/actions/SystemtapModel.java | 34 ++++---- .../yocto/sdk/remotetools/actions/Ust2Model.java | 63 ++++---------- .../sdk/remotetools/actions/UstModelLegacy.java | 54 ++++-------- 12 files changed, 243 insertions(+), 203 deletions(-) create mode 100644 plugins/org.yocto.remote.utils/.classpath create mode 100644 plugins/org.yocto.remote.utils/.project create mode 100644 plugins/org.yocto.remote.utils/.settings/org.eclipse.jdt.core.prefs create mode 100644 plugins/org.yocto.remote.utils/META-INF/MANIFEST.MF create mode 100644 plugins/org.yocto.remote.utils/build.properties create mode 100644 plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/Activator.java
--
1.7.9.5
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto