package org.eclipse.tracecompass.tmf.ui.views.callstack;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Tree;
+import org.eclipse.tracecompass.internal.tmf.core.callstack.FunctionNameMapper;
import org.eclipse.tracecompass.internal.tmf.ui.Activator;
import org.eclipse.tracecompass.internal.tmf.ui.ITmfImageConstants;
import org.eclipse.tracecompass.internal.tmf.ui.Messages;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestampDelta;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
import org.eclipse.tracecompass.tmf.ui.editors.ITmfTraceEditor;
* Main implementation for the Call Stack view
*
* @author Patrick Tasse
- * @since 2.0
*/
public class CallStackView extends TmfView {
}
private class BuildThread extends Thread {
- private final ITmfTrace fBuildTrace;
+ private final @NonNull ITmfTrace fBuildTrace;
private final ITmfTrace fParentTrace;
private final IProgressMonitor fMonitor;
- public BuildThread(ITmfTrace trace, ITmfTrace parentTrace) {
+ public BuildThread(@NonNull ITmfTrace trace, ITmfTrace parentTrace) {
super("CallStackView build"); //$NON-NLS-1$
fBuildTrace = trace;
fParentTrace = parentTrace;
*
* @param signal
* The incoming signal
- * @since 2.0
*/
@TmfSignalHandler
public void traceOpened(TmfTraceOpenedSignal signal) {
refresh();
synchronized (fBuildThreadMap) {
for (ITmfTrace trace : TmfTraceManager.getTraceSet(fTrace)) {
+ trace = checkNotNull(trace);
BuildThread buildThread = new BuildThread(trace, fTrace);
fBuildThreadMap.put(trace, buildThread);
buildThread.start();
}
}
- private void buildThreadList(final ITmfTrace trace, final ITmfTrace parentTrace, IProgressMonitor monitor) {
+ private void buildThreadList(final @NonNull ITmfTrace trace, final ITmfTrace parentTrace, IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return;
}
}
fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime, fEndTime);
- long selectionBeginTime = fTrace == null ? 0 : fTraceManager.getSelectionBeginTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
- long selectionEndTime = fTrace == null ? 0 : fTraceManager.getSelectionEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
- long startTime = fTrace == null ? 0 : fTraceManager.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
- long endTime = fTrace == null ? 0 : fTraceManager.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ TmfTraceContext ctx = TmfTraceManager.getInstance().getCurrentTraceContext();
+ long selectionBeginTime = fTrace == null ? 0 : ctx.getSelectionRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ long selectionEndTime = fTrace == null ? 0 : ctx.getSelectionRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ long startTime = fTrace == null ? 0 : ctx.getWindowRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
+ long endTime = fTrace == null ? 0 : ctx.getWindowRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
startTime = Math.max(startTime, fStartTime);
endTime = Math.min(endTime, fEndTime);
fTimeGraphCombo.getTimeGraphViewer().setSelectionRange(selectionBeginTime, selectionEndTime);
return fPrevEventAction;
}
- private static @Nullable AbstractCallStackAnalysis getCallStackModule(ITmfTrace trace) {
+ private static @Nullable AbstractCallStackAnalysis getCallStackModule(@NonNull ITmfTrace trace) {
/*
* Since we cannot know the exact analysis ID (in separate plugins), we
* will search using the analysis type.