Search in sources :

Example 1 with TmfCpuSelectedSignal

use of org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal in project tracecompass by tracecompass.

the class UnfollowCpuAction method run.

@Override
public void run() {
    fView.broadcast(new TmfCpuSelectedSignal(fView, -fCpu - 1, fTrace));
    super.run();
}
Also used : TmfCpuSelectedSignal(org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal)

Example 2 with TmfCpuSelectedSignal

use of org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal in project tracecompass by tracecompass.

the class ResourcesAndCpuViewTest method testSignals.

/**
 * Simple test to check the CPU Usage view after getting signals.
 */
@Test
public void testSignals() {
    Widget widget = fResourcesViewBot.getWidget();
    assertNotNull(widget);
    ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace();
    assertNotNull(activeTrace);
    // clear everything
    TmfCpuSelectedSignal signal = new TmfCpuSelectedSignal(widget, -1, activeTrace);
    broadcast(signal);
    assertEquals("Before signal - CPU Usage Title", "CPU Usage", getChartTitle());
    assertEquals("Before signal - Thread Table", 12, getTableCount());
    fResourcesViewBot.setFocus();
    // select cpu 1
    signal = new TmfCpuSelectedSignal(widget, 1, activeTrace);
    broadcast(signal);
    assertEquals("After signal - CPU Usage Title", "CPU Usage 1", getChartTitle());
    assertEquals("After signal - Thread Table", 4, getTableCount());
    // select cpu 3 and 1
    signal = new TmfCpuSelectedSignal(widget, 3, activeTrace);
    broadcast(signal);
    assertEquals("After signal 2 - CPU Usage Title", "CPU Usage 1, 3", getChartTitle());
    assertEquals("After signal 2 - Thread Table", 8, getTableCount());
    // reset
    signal = new TmfCpuSelectedSignal(widget, -1, activeTrace);
    broadcast(signal);
    assertEquals("After signal clear - CPU Usage Title", "CPU Usage", getChartTitle());
    assertEquals("After signal clear - Thread Table", 12, getTableCount());
}
Also used : ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) Widget(org.eclipse.swt.widgets.Widget) TmfCpuSelectedSignal(org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal) Test(org.junit.Test) XYDataProviderBaseTest(org.eclipse.tracecompass.tmf.ui.swtbot.tests.views.xychart.XYDataProviderBaseTest)

Example 3 with TmfCpuSelectedSignal

use of org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal in project tracecompass by tracecompass.

the class FollowCpuAction method run.

@Override
public void run() {
    fView.broadcast(new TmfCpuSelectedSignal(fView, fCpu, fTrace));
    super.run();
}
Also used : TmfCpuSelectedSignal(org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal)

Aggregations

TmfCpuSelectedSignal (org.eclipse.tracecompass.analysis.os.linux.core.signals.TmfCpuSelectedSignal)3 Widget (org.eclipse.swt.widgets.Widget)1 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)1 XYDataProviderBaseTest (org.eclipse.tracecompass.tmf.ui.swtbot.tests.views.xychart.XYDataProviderBaseTest)1 Test (org.junit.Test)1