Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWainer S. Moschetta2015-03-27 18:24:45 +0000
committerWainer dos Santos Moschetta2015-03-31 14:25:40 +0000
commit2ebbbbd292d3324eff75bdd0cc7dc99c5cb80109 (patch)
tree0c119dbed1b7056b95cb910d39f18526a1954a2b
parentf5cbd34820bd6e40c198b9806db36009e158ba3b (diff)
downloadorg.eclipse.linuxtools-2ebbbbd292d3324eff75bdd0cc7dc99c5cb80109.tar.gz
org.eclipse.linuxtools-2ebbbbd292d3324eff75bdd0cc7dc99c5cb80109.tar.xz
org.eclipse.linuxtools-2ebbbbd292d3324eff75bdd0cc7dc99c5cb80109.zip
oprofile: fix error when multiple executions
When executing oprofile multiple times, it has to pass "--append" parameters from second run on. However, that was passed in the end of command string (e.g. operf myApp --append), which is wrong. Change-Id: Ib75f5a8f9afaf150ab1d913ad2cd11844fe2ae0a Signed-off-by: Wainer S. Moschetta <wainersm@linux.vnet.ibm.com> Reviewed-on: https://git.eclipse.org/r/44779 Tested-by: Hudson CI Reviewed-by: Roberto Oliveira <rdutra@linux.vnet.ibm.com>
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
index c4c20428ea..c3da8ea75c 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
@@ -165,9 +165,15 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Abstra
argArray.add(0, SESSION_DIR + oprofileWorkingDirURI(config).getPath() + IPath.SEPARATOR + OPROFILE_DATA);
argArray.add(0, OprofileProject.OPERF_BINARY);
+ boolean appended = false;
for(int i = 0; i < options.getExecutionsNumber(); i++){
- if (i!=0) {
- argArray.add(APPEND);
+ /*
+ * If profiling multiple times,
+ * append oprofile results from 2nd execution on.
+ */
+ if (!appended && i!=0) {
+ argArray.add(1, APPEND);
+ appended = true;
}
String[] arguments = new String[argArray.size()];
arguments = argArray.toArray(arguments);

Back to the top