use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class CriticalPathDataProviderFactory method analysisStarted.
/**
* {@link TmfSignalHandler} for when {@link CriticalPathModule} is started, as
* the analysis is not registered with the trace, we use this to know to
* associate a {@link CriticalPathModule} to a trace.
*
* @param startAnalysisSignal
* analysis started signal
*/
@TmfSignalHandler
public synchronized void analysisStarted(TmfStartAnalysisSignal startAnalysisSignal) {
IAnalysisModule analysis = startAnalysisSignal.getAnalysisModule();
if (analysis instanceof CriticalPathModule) {
CriticalPathModule criticalPath = (CriticalPathModule) analysis;
map.put(criticalPath.getTrace(), criticalPath);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class LamiReportViewTabPage method externalUpdateSelectionCustomCharts.
/**
* Signal handler for a trace selection range update signal. It will try to
* map the external selection to our lami table entry.
*
* @param signal
* The received signal
*/
@TmfSignalHandler
public void externalUpdateSelectionCustomCharts(TmfSelectionRangeUpdatedSignal signal) {
/* Make sure we are not sending a signal to ourself */
if (signal.getSource() == this) {
return;
}
TmfTimeRange range = new TmfTimeRange(signal.getBeginTime(), signal.getEndTime());
// Custom chart signal
/* Find which lami table entry intersects the signal */
Set<Object> selection = getEntriesIntersectingTimerange(fResultTable, range);
/* Update all LamiViewer */
ChartSelectionUpdateSignal updateSignal = new ChartSelectionUpdateSignal(this, fResultTable, selection);
TmfSignalManager.dispatchSignal(updateSignal);
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class ControlFlowView method traceClosed.
@TmfSignalHandler
@Override
public void traceClosed(TmfTraceClosedSignal signal) {
ITmfTrace parentTrace = signal.getTrace();
super.traceClosed(signal);
synchronized (fFlatTraces) {
fFlatTraces.remove(parentTrace);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class CpuUsageView method cpuSelect.
/**
* Signal handler for when a cpu is selected
*
* @param signal
* the cpu being selected
* @since 2.0
*/
@TmfSignalHandler
public void cpuSelect(TmfCpuSelectedSignal signal) {
ITmfTrace trace = signal.getTrace();
TmfXYChartViewer xyViewer = getChartViewer();
TmfViewer viewer = getLeftChildViewer();
if (xyViewer instanceof CpuUsageXYViewer && viewer instanceof CpuUsageTreeViewer) {
Set<Integer> data = (Set<Integer>) getData(trace, CPU_USAGE_FOLLOW_CPU);
if (data == null) {
data = new TreeSet<>();
saveData(trace, CPU_USAGE_FOLLOW_CPU, data);
}
int core = signal.getCore();
if (core >= 0) {
data.add(core);
} else {
data.clear();
}
xyViewer.refresh();
((CpuUsageXYViewer) xyViewer).setTitle();
CpuUsageTreeViewer treeViewer = (CpuUsageTreeViewer) viewer;
treeViewer.updateContent(treeViewer.getWindowStartTime(), treeViewer.getWindowEndTime(), false);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class ResourcesView method listenToCpu.
/**
* Signal handler for a cpu selected signal.
*
* @param signal
* the cpu selected signal
* @since 2.0
*/
@TmfSignalHandler
public void listenToCpu(TmfCpuSelectedSignal signal) {
int data = signal.getCore() >= 0 ? signal.getCore() : -1;
ITmfTrace trace = getTrace();
if (trace == null) {
return;
}
TmfTraceManager.getInstance().updateTraceContext(trace, builder -> builder.setData(RESOURCES_FOLLOW_CPU, data));
}
Aggregations