use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class ResourcesView method listenToCurrentThread.
/**
* Signal handler for a thread selected signal.
*
* @param signal
* the thread selected signal
* @since 2.0
*/
@TmfSignalHandler
public void listenToCurrentThread(TmfThreadSelectedSignal signal) {
HostThread data = signal.getThreadId() >= 0 ? signal.getHostThread() : null;
ITmfTrace trace = getTrace();
if (trace == null) {
return;
}
TmfTraceManager.getInstance().updateTraceContext(trace, builder -> builder.setData(HostThread.SELECTED_HOST_THREAD_KEY, data));
if (data != null) {
// $NON-NLS-1$ //$NON-NLS-2$
setFollowedThread("Current_thread==" + data.getTid() + " || TID==" + data.getTid());
} else {
removeFollowedThread();
}
restartZoomThread();
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class FlameGraphView method traceSelected.
/**
* Handler for the trace selected signal
*
* @param signal
* The incoming signal
*/
@TmfSignalHandler
public void traceSelected(final TmfTraceSelectedSignal signal) {
ITmfTrace trace = signal.getTrace();
fTrace = trace;
if (trace != null) {
Iterable<CallStackAnalysis> csModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, CallStackAnalysis.class);
List<CallGraphAnalysis> cgModules = new ArrayList<>();
for (CallStackAnalysis csModule : csModules) {
csModule.schedule();
ICallGraphProvider cgModule = csModule.getCallGraph();
if (cgModule instanceof CallGraphAnalysis) {
cgModules.add((CallGraphAnalysis) cgModule);
}
}
fFlamegraphModules = cgModules;
buildFlameGraph(cgModules);
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class AbstractSegmentStoreDensityViewer method windowRangeUpdated.
/**
* Signal handler for handling of the window range signal.
*
* @param signal
* The {@link TmfWindowRangeUpdatedSignal}
*/
@TmfSignalHandler
public void windowRangeUpdated(@Nullable TmfWindowRangeUpdatedSignal signal) {
if (signal == null) {
return;
}
ITmfTrace parent = getTrace();
if (parent == null) {
return;
}
fCurrentTimeRange = NonNullUtils.checkNotNull(signal.getCurrentRange());
updateWindowRange(fCurrentTimeRange, false);
updateWithRange(fCurrentTimeRange);
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class AbstractSegmentStoreTableViewer method traceOpened.
/**
* Trace opened handler
*
* @param signal
* New trace (on which segment store analysis has not been
* performed) is opened
*/
@TmfSignalHandler
public void traceOpened(TmfTraceOpenedSignal signal) {
ITmfTrace trace = signal.getTrace();
if (trace != fTrace) {
// Cancel the filtering job from the previous trace
Job job = fFilteringJob;
if (job != null) {
job.cancel();
}
}
fTrace = trace;
if (trace != null) {
setData(getSegmentStoreProvider(trace));
}
}
use of org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler in project tracecompass by tracecompass.
the class TmfPerspectiveManager method traceOpened.
/**
* Signal handler for the traceOpened signal.
*
* @param signal
* The incoming signal
*/
@TmfSignalHandler
public synchronized void traceOpened(final TmfTraceOpenedSignal signal) {
Display.getDefault().asyncExec(() -> {
String id = TmfTraceTypeUIUtils.getPerspectiveId(signal.getTrace());
if (id == null) {
/*
* For experiments, switch only if all traces have the same
* associated perspective id.
*/
for (ITmfTrace trace : TmfTraceManager.getTraceSet(signal.getTrace())) {
String perspectiveId = TmfTraceTypeUIUtils.getPerspectiveId(trace);
if (id != null && !id.equals(perspectiveId)) {
return;
}
id = perspectiveId;
}
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (id != null && window != null && shouldSwitchPerspective(window, id, ITmfUIPreferences.SWITCH_TO_PERSPECTIVE)) {
switchToPerspective(window, id);
}
});
}
Aggregations