Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrajesh2014-02-04 08:19:23 +0000
committerRodrigo Fraxino Araujo2014-02-04 15:53:31 +0000
commit35639d398348d4d4e58164fdd5822d9260dd190a (patch)
treebe6b941dbb2715007a3c92ea7616e406a8f840de /oprofile
parent809270d66397f3d17e5db2aec27e1dcb76be4da6 (diff)
downloadorg.eclipse.linuxtools-35639d398348d4d4e58164fdd5822d9260dd190a.tar.gz
org.eclipse.linuxtools-35639d398348d4d4e58164fdd5822d9260dd190a.tar.xz
org.eclipse.linuxtools-35639d398348d4d4e58164fdd5822d9260dd190a.zip
[oprofile]: unit masks in oprofile are not being saved
fix for bug 427280 updating unit mask field in event tab UI are not reflecting while doing profile using operf. patch fix this issue. Change-Id: I7dbfcb648bd2ed786ebdebb091ecb01433895d34 Signed-off-by: Brajesh <brrathor@linux.vnet.ibm.com> Reviewed-on: https://git.eclipse.org/r/21494 Reviewed-by: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com> IP-Clean: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com> Tested-by: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com>
Diffstat (limited to 'oprofile')
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java6
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/META-INF/MANIFEST.MF1
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java23
3 files changed, 25 insertions, 5 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java
index 1992f082a7..8b6eaf0635 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java
@@ -65,9 +65,9 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
private static final String OPD_SETUP_SEPARATE_CPU = "cpu"; //$NON-NLS-1$
private static final String OPD_SETUP_EVENT = "--event="; //$NON-NLS-1$
- private static final String OPD_SETUP_EVENT_SEPARATOR = ":"; //$NON-NLS-1$
- private static final String OPD_SETUP_EVENT_TRUE = "1"; //$NON-NLS-1$
- private static final String OPD_SETUP_EVENT_FALSE = "0"; //$NON-NLS-1$
+ public static final String OPD_SETUP_EVENT_SEPARATOR = ":"; //$NON-NLS-1$
+ public static final String OPD_SETUP_EVENT_TRUE = "1"; //$NON-NLS-1$
+ public static final String OPD_SETUP_EVENT_FALSE = "0"; //$NON-NLS-1$
private static final String OPD_SETUP_EVENT_DEFAULT = "default"; //$NON-NLS-1$
private static final String OPD_SETUP_IMAGE = "--image="; //$NON-NLS-1$
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/META-INF/MANIFEST.MF b/oprofile/org.eclipse.linuxtools.oprofile.launch/META-INF/MANIFEST.MF
index 8a50b39b24..b859fee772 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/META-INF/MANIFEST.MF
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/META-INF/MANIFEST.MF
@@ -23,6 +23,7 @@ Import-Package: org.eclipse.cdt.core.model,
org.eclipse.debug.ui,
org.eclipse.linuxtools.internal.oprofile.core,
org.eclipse.linuxtools.internal.oprofile.core.daemon,
+ org.eclipse.linuxtools.internal.oprofile.core.linux,
org.eclipse.linuxtools.internal.oprofile.ui,
org.eclipse.linuxtools.internal.oprofile.ui.view,
org.eclipse.linuxtools.profiling.launch,
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 48f60fbd93..b33ed79ab5 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
@@ -39,6 +39,7 @@ import org.eclipse.linuxtools.internal.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.internal.oprofile.core.Oprofile.OprofileProject;
import org.eclipse.linuxtools.internal.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.internal.oprofile.core.daemon.OprofileDaemonOptions;
+import org.eclipse.linuxtools.internal.oprofile.core.linux.LinuxOpcontrolProvider;
import org.eclipse.linuxtools.internal.oprofile.launch.OprofileLaunchMessages;
import org.eclipse.linuxtools.internal.oprofile.launch.OprofileLaunchPlugin;
import org.eclipse.linuxtools.internal.oprofile.launch.configuration.LaunchOptions;
@@ -115,10 +116,28 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Profil
// outputing the profiling data to the project dir/OPROFILE_DATA
if (OprofileProject.getProfilingBinary().equals(OprofileProject.OPERF_BINARY)) {
- String eventsString=EVENTS;
+ String eventsString=null;
+
+ // Event spec: "EVENT:count:mask:profileKernel:profileUser"
+ StringBuilder spec = new StringBuilder();
+ spec.append(EVENTS);
+ boolean isCommaAllowed = false;
for (int i=0;i<events.size();i++) {
- eventsString+=events.get(i).getEvent().getText() + ":" + events.get(i).getResetCount() + ","; //$NON-NLS-1$ //$NON-NLS-2$
+ OprofileDaemonEvent event = events.get(i);
+ if(isCommaAllowed)
+ spec.append(",");
+ spec.append(event.getEvent().getText());
+ spec.append(LinuxOpcontrolProvider.OPD_SETUP_EVENT_SEPARATOR);
+ spec.append(event.getResetCount());
+ spec.append(LinuxOpcontrolProvider.OPD_SETUP_EVENT_SEPARATOR);
+ spec.append(event.getEvent().getUnitMask().getMaskValue());
+ spec.append(LinuxOpcontrolProvider.OPD_SETUP_EVENT_SEPARATOR);
+ spec.append((event.getProfileKernel() ? LinuxOpcontrolProvider.OPD_SETUP_EVENT_TRUE : LinuxOpcontrolProvider.OPD_SETUP_EVENT_FALSE));
+ spec.append(LinuxOpcontrolProvider.OPD_SETUP_EVENT_SEPARATOR);
+ spec.append((event.getProfileUser() ? LinuxOpcontrolProvider.OPD_SETUP_EVENT_TRUE : LinuxOpcontrolProvider.OPD_SETUP_EVENT_FALSE));
+ isCommaAllowed = true;
}
+ eventsString = spec.toString();
ArrayList<String> argArray = new ArrayList<>(Arrays.asList(getProgramArgumentsArray( config )));
IFolder dataFolder = Oprofile.OprofileProject.getProject().getFolder(OPROFILE_DATA);

Back to the top