Search in sources :

Example 6 with PerfVersion

use of org.eclipse.linuxtools.internal.perf.PerfVersion in project linuxtools by eclipse.

the class PerfVersionTest method testPerfVersionString.

@Test
public void testPerfVersionString() {
    PerfVersion version = new PerfVersion("4.2.3.300.fc23.x86_64.g21b8");
    assertEquals(4, version.getMajor());
    assertEquals(2, version.getMinor());
    assertEquals(3, version.getMicro());
    assertEquals("300.fc23.x86_64.g21b8", version.getQualifier());
}
Also used : PerfVersion(org.eclipse.linuxtools.internal.perf.PerfVersion) Test(org.junit.Test)

Example 7 with PerfVersion

use of org.eclipse.linuxtools.internal.perf.PerfVersion in project linuxtools by eclipse.

the class PerfOptionsTab method performApply.

@Override
public void performApply(ILaunchConfigurationWorkingCopy wconfig) {
    PerfVersion perfVersion = PerfCore.getPerfVersion(wconfig);
    if (perfVersion != null && multiplexEventsVersion.isNewer(perfVersion)) {
        wconfig.setAttribute(PerfPlugin.ATTR_Multiplex, chkMultiplexEvents.getSelection());
    }
    wconfig.setAttribute(PerfPlugin.ATTR_Kernel_Location, txtKernelLocation.getText());
    wconfig.setAttribute(PerfPlugin.ATTR_Record_Realtime, chkRecordRealtime.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_Record_Realtime_Priority, rtPriority.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_Record_Verbose, chkRecordVerbose.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_SourceLineNumbers, chkSourceLineNumbers.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_Kernel_SourceLineNumbers, chkKernelSourceLineNumbers.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_ModuleSymbols, chkModuleSymbols.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_HideUnresolvedSymbols, chkHideUnresolvedSymbols.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_ShowSourceDisassembly, chkShowSourceDisassembly.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_ShowStat, chkShowStat.getSelection());
    wconfig.setAttribute(PerfPlugin.ATTR_StatRunCount, statRunCount.getSelection());
}
Also used : PerfVersion(org.eclipse.linuxtools.internal.perf.PerfVersion)

Example 8 with PerfVersion

use of org.eclipse.linuxtools.internal.perf.PerfVersion in project linuxtools by eclipse.

the class PerfOptionsTab method initializeFrom.

@Override
public void initializeFrom(ILaunchConfiguration config) {
    // Keep track of the last configuration loaded
    lastConfig = config;
    PerfVersion perfVersion = PerfCore.getPerfVersion(config);
    try {
        if (perfVersion != null && multiplexEventsVersion.isNewer(perfVersion)) {
            chkMultiplexEvents.setSelection(config.getAttribute(PerfPlugin.ATTR_Multiplex, PerfPlugin.ATTR_Multiplex_default));
        }
        txtKernelLocation.setText(config.getAttribute(PerfPlugin.ATTR_Kernel_Location, PerfPlugin.ATTR_Kernel_Location_default));
        chkRecordRealtime.setSelection(config.getAttribute(PerfPlugin.ATTR_Record_Realtime, PerfPlugin.ATTR_Record_Realtime_default));
        int priority = config.getAttribute(PerfPlugin.ATTR_Record_Realtime_Priority, PerfPlugin.ATTR_Record_Realtime_Priority_default);
        rtPriority.setEnabled(chkRecordRealtime.getSelection());
        rtPriority.setSelection(priority);
        chkRecordVerbose.setSelection(config.getAttribute(PerfPlugin.ATTR_Record_Verbose, PerfPlugin.ATTR_Record_Verbose_default));
        chkSourceLineNumbers.setSelection(config.getAttribute(PerfPlugin.ATTR_SourceLineNumbers, PerfPlugin.ATTR_SourceLineNumbers_default));
        chkKernelSourceLineNumbers.setSelection(config.getAttribute(PerfPlugin.ATTR_Kernel_SourceLineNumbers, PerfPlugin.ATTR_Kernel_SourceLineNumbers_default));
        chkModuleSymbols.setSelection(config.getAttribute(PerfPlugin.ATTR_ModuleSymbols, PerfPlugin.ATTR_ModuleSymbols_default));
        chkHideUnresolvedSymbols.setSelection(config.getAttribute(PerfPlugin.ATTR_HideUnresolvedSymbols, PerfPlugin.ATTR_HideUnresolvedSymbols_default));
        chkShowSourceDisassembly.setSelection(config.getAttribute(PerfPlugin.ATTR_ShowSourceDisassembly, PerfPlugin.ATTR_ShowSourceDisassembly_default));
        chkShowStat.setSelection(config.getAttribute(PerfPlugin.ATTR_ShowStat, PerfPlugin.ATTR_ShowStat_default));
        int runCount = config.getAttribute(PerfPlugin.ATTR_StatRunCount, PerfPlugin.ATTR_StatRunCount_default);
        statRunCount.setSelection(runCount);
        handleShowStatSelection();
    } catch (CoreException e) {
    // do nothing
    }
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) Point(org.eclipse.swt.graphics.Point) PerfVersion(org.eclipse.linuxtools.internal.perf.PerfVersion)

Aggregations

PerfVersion (org.eclipse.linuxtools.internal.perf.PerfVersion)8 Test (org.junit.Test)5 CoreException (org.eclipse.core.runtime.CoreException)1 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)1 Point (org.eclipse.swt.graphics.Point)1 Button (org.eclipse.swt.widgets.Button)1 Shell (org.eclipse.swt.widgets.Shell)1 Text (org.eclipse.swt.widgets.Text)1