aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrajesh2014-02-04 03:19:23 -0500
committerJeff Johnston2014-02-04 17:05:33 -0500
commitdd264cbf87c7d7d5fa047ab6ecafbe7123039818 (patch)
tree9fab69334ede3bf28cacec2cc0cac7aa738dc7bc
parent5e24326439bceabf28e81530939bec7c2646abf5 (diff)
downloadorg.eclipse.linuxtools-dd264cbf87c7d7d5fa047ab6ecafbe7123039818.zip
org.eclipse.linuxtools-dd264cbf87c7d7d5fa047ab6ecafbe7123039818.tar.gz
org.eclipse.linuxtools-dd264cbf87c7d7d5fa047ab6ecafbe7123039818.tar.xz
[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> Reviewed-on: https://git.eclipse.org/r/21537 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/linux/LinuxOpcontrolProvider.java2
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java35
2 files changed, 29 insertions, 8 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 b8f8548..3f82d24 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
@@ -101,7 +101,7 @@ public class LinuxOpcontrolProvider implements IOpcontrolProvider {
// Logging verbosity. Specified with setupDaemon.
//--verbosity=all generates WAY too much stuff in the log
- private String verbosity = ""; //$NON-NLS-1$
+ private final String verbosity = ""; //$NON-NLS-1$
public LinuxOpcontrolProvider() {
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 9fd0237..9d6969d 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
@@ -35,8 +35,8 @@ import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.linuxtools.internal.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.internal.oprofile.core.Oprofile;
-import org.eclipse.linuxtools.internal.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.internal.oprofile.core.Oprofile.OprofileProject;
+import org.eclipse.linuxtools.internal.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.internal.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.internal.oprofile.core.daemon.OprofileDaemonOptions;
import org.eclipse.linuxtools.internal.oprofile.launch.OprofileLaunchMessages;
@@ -54,10 +54,13 @@ import org.eclipse.ui.PlatformUI;
public abstract class AbstractOprofileLaunchConfigurationDelegate extends ProfileLaunchConfigurationDelegate {
protected ILaunchConfiguration config;
- private String OPROFILE_DATA = "oprofile_data"; //$NON-NLS-1$
- private String SESSION_DIR = "--session-dir="; //$NON-NLS-1$
- private String EVENTS = "--events="; //$NON-NLS-1$
- private String APPEND = "--append"; //$NON-NLS-1$
+ private final String OPROFILE_DATA = "oprofile_data"; //$NON-NLS-1$
+ private final String SESSION_DIR = "--session-dir="; //$NON-NLS-1$
+ private final String EVENTS = "--events="; //$NON-NLS-1$
+ private final String APPEND = "--append"; //$NON-NLS-1$
+ private final String OPD_SETUP_EVENT_SEPARATOR = ":"; //$NON-NLS-1$
+ private final String OPD_SETUP_EVENT_TRUE = "1"; //$NON-NLS-1$
+ private final String OPD_SETUP_EVENT_FALSE="0"; //$NON-NLS-1$
@Override
public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
@@ -113,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(","); //$NON-NLS-1$
+ spec.append(event.getEvent().getText());
+ spec.append(OPD_SETUP_EVENT_SEPARATOR);
+ spec.append(event.getResetCount());
+ spec.append(OPD_SETUP_EVENT_SEPARATOR);
+ spec.append(event.getEvent().getUnitMask().getMaskValue());
+ spec.append(OPD_SETUP_EVENT_SEPARATOR);
+ spec.append((event.getProfileKernel() ? OPD_SETUP_EVENT_TRUE : OPD_SETUP_EVENT_FALSE));
+ spec.append(OPD_SETUP_EVENT_SEPARATOR);
+ spec.append((event.getProfileUser() ? OPD_SETUP_EVENT_TRUE : OPD_SETUP_EVENT_FALSE));
+ isCommaAllowed = true;
}
+ eventsString = spec.toString();
ArrayList<String> argArray = new ArrayList<String>(Arrays.asList(getProgramArgumentsArray( config )));
IFolder dataFolder = Oprofile.OprofileProject.getProject().getFolder(OPROFILE_DATA);