diff options
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 b8f8548a81..3f82d24a01 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 9fd0237b13..9d6969d8f5 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); |