Search in sources :

Example 6 with TimeGraphEntryModel

use of org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel in project tracecompass by tracecompass.

the class ThreadStatusDataProvider method fetchTree.

@Override
@NonNull
public TmfModelResponse<@NonNull TmfTreeModel<@NonNull TimeGraphEntryModel>> fetchTree(@NonNull Map<@NonNull String, @NonNull Object> fetchParameters, @Nullable IProgressMonitor monitor) {
    if (fLastEnd == Long.MAX_VALUE) {
        return new TmfModelResponse<>(new TmfTreeModel<>(Collections.emptyList(), filter(Objects.requireNonNull(fTraceEntry), fTidToEntry, fetchParameters)), ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED);
    }
    fModule.waitForInitialization();
    ITmfStateSystem ss = fModule.getStateSystem();
    if (ss == null) {
        return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.ANALYSIS_INITIALIZATION_FAILED);
    }
    /*
         * As we are caching the intermediate result, we only want a single thread to
         * update them.
         */
    synchronized (fBuildMap) {
        boolean complete = ss.waitUntilBuilt(0);
        @NonNull List<@NonNull TimeGraphEntryModel> list = Collections.emptyList();
        /* Don't query empty state system */
        if (ss.getNbAttributes() > 0 && ss.getStartTime() != Long.MIN_VALUE) {
            long end = ss.getCurrentEndTime();
            fLastEnd = Long.max(fLastEnd, ss.getStartTime());
            TreeMultimap<Integer, ITmfStateInterval> threadData = TreeMultimap.create(Comparator.naturalOrder(), Comparator.comparing(ITmfStateInterval::getStartTime));
            /*
                 * Create a List with the threads' PPID and EXEC_NAME quarks for the 2D query .
                 */
            List<Integer> quarks = new ArrayList<>(ss.getQuarks(Attributes.THREADS, WILDCARD, Attributes.EXEC_NAME));
            quarks.addAll(ss.getQuarks(Attributes.THREADS, WILDCARD, Attributes.PPID));
            quarks.addAll(ss.getQuarks(Attributes.THREADS, WILDCARD, Attributes.PID));
            try {
                for (ITmfStateInterval interval : ss.query2D(quarks, Long.min(fLastEnd, end), end)) {
                    if (monitor != null && monitor.isCanceled()) {
                        return new TmfModelResponse<>(null, ITmfResponse.Status.CANCELLED, CommonStatusMessage.TASK_CANCELLED);
                    }
                    threadData.put(interval.getAttribute(), interval);
                }
            } catch (TimeRangeException | StateSystemDisposedException e) {
                return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, e.getClass().getName() + ':' + String.valueOf(e.getMessage()));
            }
            // update the trace Entry.
            TimeGraphEntryModel traceEntry = new TimeGraphEntryModel(fTraceId, -1, getTrace().getName(), ss.getStartTime(), end);
            fTraceEntry = traceEntry;
            for (Integer threadQuark : ss.getQuarks(Attributes.THREADS, WILDCARD)) {
                String threadAttributeName = ss.getAttributeName(threadQuark);
                Pair<Integer, Integer> entryKey = Attributes.parseThreadAttributeName(threadAttributeName);
                int threadId = entryKey.getFirst();
                if (threadId < 0) {
                    // ignore the 'unknown' (-1) thread
                    continue;
                }
                int execNameQuark = ss.optQuarkRelative(threadQuark, Attributes.EXEC_NAME);
                int ppidQuark = ss.optQuarkRelative(threadQuark, Attributes.PPID);
                int pidQuark = ss.optQuarkRelative(threadQuark, Attributes.PID);
                NavigableSet<ITmfStateInterval> ppidIntervals = threadData.get(ppidQuark);
                NavigableSet<ITmfStateInterval> pidIntervals = threadData.get(pidQuark);
                for (ITmfStateInterval execNameInterval : threadData.get(execNameQuark)) {
                    if (monitor != null && monitor.isCanceled()) {
                        return new TmfModelResponse<>(null, ITmfResponse.Status.CANCELLED, CommonStatusMessage.TASK_CANCELLED);
                    }
                    updateEntry(threadQuark, entryKey, ppidIntervals, execNameInterval, pidIntervals);
                }
            }
            fLastEnd = end;
            list = filter(traceEntry, fTidToEntry, fetchParameters);
        }
        for (TimeGraphEntryModel model : list) {
            fEntryMetadata.put(model.getId(), model.getMetadata());
        }
        if (complete) {
            fBuildMap.clear();
            fLastEnd = Long.MAX_VALUE;
            return new TmfModelResponse<>(new TmfTreeModel<>(Collections.emptyList(), list), ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED);
        }
        return new TmfModelResponse<>(new TmfTreeModel<>(Collections.emptyList(), list), ITmfResponse.Status.RUNNING, CommonStatusMessage.RUNNING);
    }
}
Also used : TimeRangeException(org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException) ITmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval) ArrayList(java.util.ArrayList) TmfModelResponse(org.eclipse.tracecompass.tmf.core.response.TmfModelResponse) StateSystemDisposedException(org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException) NonNull(org.eclipse.jdt.annotation.NonNull) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) ITmfStateSystem(org.eclipse.tracecompass.statesystem.core.ITmfStateSystem) NonNull(org.eclipse.jdt.annotation.NonNull)

Example 7 with TimeGraphEntryModel

use of org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel in project tracecompass by tracecompass.

the class ThreadStatusDataProvider method filter.

/**
 * Filter the threads from a {@link TreeMultimap} according to if they are
 * active or not
 * @param traceEntry
 *
 * @param tidToEntry
 *            Threads to filter
 * @param filter
 *            time range to query
 * @return a list of the active threads
 */
@NonNull
private List<@NonNull TimeGraphEntryModel> filter(TimeGraphEntryModel traceEntry, TreeMultimap<Integer, ThreadEntryModel.Builder> tidToEntry, @NonNull Map<@NonNull String, @NonNull Object> parameters) {
    // avoid putting everything as a child of the swapper thread.
    Boolean isActiveFilter = DataProviderParameterUtils.extractBoolean(parameters, ACTIVE_THREAD_FILTER_KEY);
    if (!Boolean.TRUE.equals(isActiveFilter)) {
        ImmutableList.Builder<TimeGraphEntryModel> builder = ImmutableList.builder();
        builder.add(traceEntry);
        for (ThreadEntryModel.Builder entryBuilder : tidToEntry.values()) {
            builder.add(build(entryBuilder));
        }
        return builder.build();
    }
    ITmfStateSystem ss = fModule.getStateSystem();
    if (ss == null) {
        return Collections.emptyList();
    }
    List<@NonNull Long> filter = DataProviderParameterUtils.extractTimeRequested(parameters);
    if (filter == null || filter.isEmpty()) {
        return Collections.emptyList();
    }
    long start = Long.max(filter.get(0), ss.getStartTime());
    long end = Long.min(filter.get(filter.size() - 1), ss.getCurrentEndTime());
    if (start > end) {
        return Collections.emptyList();
    }
    List<@NonNull Long> selectedItems = DataProviderParameterUtils.extractSelectedItems(parameters);
    if (selectedItems != null) {
        Set<Long> cpus = Sets.newHashSet(selectedItems);
        List<@NonNull Integer> quarks = ss.getQuarks(Attributes.THREADS, WILDCARD, Attributes.CURRENT_CPU_RQ);
        Set<TimeGraphEntryModel> models = new HashSet<>();
        models.add(traceEntry);
        Map<Integer, Integer> rqToPidCache = new HashMap<>();
        try {
            for (ITmfStateInterval interval : ss.query2D(quarks, Long.max(ss.getStartTime(), start), end)) {
                Object o = interval.getValue();
                if (o instanceof Number && cpus.contains(((Number) o).longValue())) {
                    int attribute = interval.getAttribute();
                    try {
                        // Get the name of the thread
                        int nameQuark = ss.getQuarkRelative(ss.getParentAttributeQuark(attribute), Attributes.EXEC_NAME);
                        Iterable<@NonNull ITmfStateInterval> names2d = ss.query2D(Collections.singleton(nameQuark), interval.getStartTime(), interval.getEndTime());
                        Iterable<@NonNull String> names = Iterables.transform(names2d, intervalName -> String.valueOf(intervalName.getValue()));
                        int tid = rqToPidCache.computeIfAbsent(attribute, a -> Attributes.parseThreadAttributeName(ss.getAttributeName(ss.getParentAttributeQuark(a))).getFirst());
                        // Skip Idle (thread 0)
                        if (tid == 0) {
                            continue;
                        }
                        for (ThreadEntryModel.Builder model : tidToEntry.get(tid)) {
                            if (interval.getStartTime() <= model.getEndTime() && model.getStartTime() <= interval.getEndTime()) {
                                ThreadEntryModel build = build(model);
                                if (!Iterables.any(names, name -> name.equals(build.getName()))) {
                                    continue;
                                }
                                models.add(build);
                            }
                        }
                    } catch (AttributeNotFoundException e) {
                        // $NON-NLS-1$
                        Activator.getDefault().logWarning("Unable to get the quark for the attribute name", e);
                    }
                }
            }
        } catch (IndexOutOfBoundsException | TimeRangeException e) {
            // $NON-NLS-1$
            Activator.getDefault().logError("Invalid query parameters", e);
        } catch (StateSystemDisposedException e) {
            return Collections.emptyList();
        }
        return Lists.newArrayList(models);
    }
    ImmutableList.Builder<TimeGraphEntryModel> builder = ImmutableList.builder();
    builder.add(traceEntry);
    for (ThreadEntryModel.Builder thread : tidToEntry.values()) {
        Integer statusQuark = fQuarkMap.get(thread.getId());
        if (statusQuark == null) {
            continue;
        }
        QuarkIterator iterator = new QuarkIterator(ss, statusQuark, start, end);
        Iterator<Object> values = Iterators.transform(iterator, ITmfStateInterval::getValue);
        if (Iterators.any(values, ACTIVE_STATES::contains)) {
            builder.add(build(thread));
        }
    }
    return builder.build();
}
Also used : ITmfCallsite(org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite) OsStrings(org.eclipse.tracecompass.analysis.os.linux.core.model.OsStrings) IOutputAnnotationProvider(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.IOutputAnnotationProvider) ITmfEventAspect(org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect) Attributes(org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.Attributes) TmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.TmfStateInterval) Pair(org.eclipse.tracecompass.tmf.core.util.Pair) LinuxTidAspect(org.eclipse.tracecompass.analysis.os.linux.core.event.aspect.LinuxTidAspect) Nullable(org.eclipse.jdt.annotation.Nullable) TreeMultimap(com.google.common.collect.TreeMultimap) KernelAnalysisModule(org.eclipse.tracecompass.analysis.os.linux.core.kernel.KernelAnalysisModule) ITmfStateSystem(org.eclipse.tracecompass.statesystem.core.ITmfStateSystem) Map(java.util.Map) ITmfCallsiteResolver(org.eclipse.tracecompass.tmf.core.analysis.callsite.ITmfCallsiteResolver) TmfStrings(org.eclipse.tracecompass.tmf.core.TmfStrings) LinuxStyle(org.eclipse.tracecompass.internal.analysis.os.linux.core.registry.LinuxStyle) OutputElementStyle(org.eclipse.tracecompass.tmf.core.model.OutputElementStyle) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) ITmfTrace(org.eclipse.tracecompass.tmf.core.trace.ITmfTrace) ImmutableSet(com.google.common.collect.ImmutableSet) TmfCpuAspect(org.eclipse.tracecompass.tmf.core.event.aspect.TmfCpuAspect) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) Collection(java.util.Collection) FetchParametersUtils(org.eclipse.tracecompass.internal.tmf.core.model.filters.FetchParametersUtils) IOutputStyleProvider(org.eclipse.tracecompass.tmf.core.model.IOutputStyleProvider) Set(java.util.Set) ITimeGraphDataProvider(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider) NavigableSet(java.util.NavigableSet) OutputStyleModel(org.eclipse.tracecompass.tmf.core.model.OutputStyleModel) Sets(com.google.common.collect.Sets) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) SelectionTimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter) Objects(java.util.Objects) List(java.util.List) TimeRangeException(org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException) Entry(java.util.Map.Entry) CallsiteAnalysis(org.eclipse.tracecompass.internal.tmf.core.analysis.callsite.CallsiteAnalysis) AnnotationModel(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationModel) NonNull(org.eclipse.jdt.annotation.NonNull) AnnotationCategoriesModel(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.AnnotationCategoriesModel) ITmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval) Iterables(com.google.common.collect.Iterables) CommonStatusMessage(org.eclipse.tracecompass.tmf.core.model.CommonStatusMessage) ITimeGraphRowModel(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphRowModel) TmfTreeModel(org.eclipse.tracecompass.tmf.core.model.tree.TmfTreeModel) HashMap(java.util.HashMap) TimeGraphModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphModel) Multimap(com.google.common.collect.Multimap) TimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.TimeQueryFilter) Iterators(com.google.common.collect.Iterators) ArrayList(java.util.ArrayList) EventAnnotationProvider(org.eclipse.tracecompass.internal.provisional.tmf.core.model.annotations.EventAnnotationProvider) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) Activator(org.eclipse.tracecompass.internal.analysis.os.linux.core.Activator) TimeGraphRowModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphRowModel) StateValues(org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.StateValues) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) TimeGraphArrow(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphArrow) AttributeNotFoundException(org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException) TmfModelResponse(org.eclipse.tracecompass.tmf.core.response.TmfModelResponse) ITimeGraphArrow(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphArrow) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) StateSystemDisposedException(org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException) ITmfResponse(org.eclipse.tracecompass.tmf.core.response.ITmfResponse) ITimeGraphState(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphState) Iterator(java.util.Iterator) ProcessStatus(org.eclipse.tracecompass.analysis.os.linux.core.model.ProcessStatus) TimeGraphState(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphState) DataProviderParameterUtils(org.eclipse.tracecompass.tmf.core.dataprovider.DataProviderParameterUtils) IKernelTrace(org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace) AtomicLong(java.util.concurrent.atomic.AtomicLong) QuarkIterator(org.eclipse.tracecompass.statesystem.core.StateSystemUtils.QuarkIterator) AbstractTmfTraceDataProvider(org.eclipse.tracecompass.internal.tmf.core.model.AbstractTmfTraceDataProvider) TmfTraceUtils(org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils) Comparator(java.util.Comparator) ITimeGraphStateFilter(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphStateFilter) Collections(java.util.Collections) AttributeNotFoundException(org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ImmutableList(com.google.common.collect.ImmutableList) ITmfStateInterval(org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval) StateSystemDisposedException(org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException) QuarkIterator(org.eclipse.tracecompass.statesystem.core.StateSystemUtils.QuarkIterator) ITmfStateSystem(org.eclipse.tracecompass.statesystem.core.ITmfStateSystem) HashSet(java.util.HashSet) TimeRangeException(org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) AtomicLong(java.util.concurrent.atomic.AtomicLong) NonNull(org.eclipse.jdt.annotation.NonNull)

Example 8 with TimeGraphEntryModel

use of org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel in project tracecompass by tracecompass.

the class ControlFlowCheckActiveProvider method getActiveIds.

private Set<Long> getActiveIds(TimeGraphEntry cfe, TmfTimeRange range) {
    ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = BaseDataProviderTimeGraphView.getProvider(cfe);
    if (range.equals(fRange) && dataProvider.equals(fProvider) || !(dataProvider instanceof ThreadStatusDataProvider)) {
        return fActive;
    }
    TimeQueryFilter filter = new TimeQueryFilter(range.getStartTime().toNanos(), range.getEndTime().toNanos(), 2);
    Map<@NonNull String, @NonNull Object> parameters = FetchParametersUtils.timeQueryToMap(filter);
    parameters.put(ThreadStatusDataProvider.ACTIVE_THREAD_FILTER_KEY, true);
    TmfModelResponse<TmfTreeModel<@NonNull TimeGraphEntryModel>> response = ((ThreadStatusDataProvider) dataProvider).fetchTree(parameters, null);
    TmfTreeModel<@NonNull TimeGraphEntryModel> model = response.getModel();
    if (model == null) {
        // query must have failed, return empty and don't invalidate the cache.
        return Collections.emptySet();
    }
    fRange = range;
    fActive = model.getEntries().stream().map(TimeGraphEntryModel::getId).collect(Collectors.toSet());
    return fActive;
}
Also used : NonNull(org.eclipse.jdt.annotation.NonNull) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) TmfTreeModel(org.eclipse.tracecompass.tmf.core.model.tree.TmfTreeModel) TimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.TimeQueryFilter) ThreadStatusDataProvider(org.eclipse.tracecompass.internal.analysis.os.linux.core.threadstatus.ThreadStatusDataProvider)

Example 9 with TimeGraphEntryModel

use of org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel in project tracecompass by tracecompass.

the class ActiveThreadsFilter method getActiveThreads.

@NonNull
private static Set<Long> getActiveThreads(TmfTimeRange winRange, @NonNull ITmfTrace trace) {
    ThreadStatusDataProvider threadStatusProvider = DataProviderManager.getInstance().getDataProvider(trace, ThreadStatusDataProvider.ID, ThreadStatusDataProvider.class);
    if (threadStatusProvider == null) {
        return Collections.emptySet();
    }
    long beginTS = winRange.getStartTime().getValue();
    long endTS = winRange.getEndTime().getValue();
    TimeQueryFilter filter = new TimeQueryFilter(beginTS, endTS, 2);
    Map<@NonNull String, @NonNull Object> parameters = FetchParametersUtils.timeQueryToMap(filter);
    parameters.put(ThreadStatusDataProvider.ACTIVE_THREAD_FILTER_KEY, true);
    TmfModelResponse<TmfTreeModel<@NonNull TimeGraphEntryModel>> response = threadStatusProvider.fetchTree(parameters, null);
    TmfTreeModel<@NonNull TimeGraphEntryModel> model = response.getModel();
    if (model == null) {
        return Collections.emptySet();
    }
    HashSet<Long> activeThreads = Sets.newHashSet(Iterables.transform(model.getEntries(), TimeGraphEntryModel::getId));
    return activeThreads == null ? Collections.emptySet() : activeThreads;
}
Also used : NonNull(org.eclipse.jdt.annotation.NonNull) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) TmfTreeModel(org.eclipse.tracecompass.tmf.core.model.tree.TmfTreeModel) TimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.TimeQueryFilter) SelectionTimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter) ThreadStatusDataProvider(org.eclipse.tracecompass.internal.analysis.os.linux.core.threadstatus.ThreadStatusDataProvider) NonNull(org.eclipse.jdt.annotation.NonNull)

Example 10 with TimeGraphEntryModel

use of org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel in project tracecompass by tracecompass.

the class FlameChartView method getPreviousEventAction.

/**
 * Get the previous event action.
 *
 * @return The Action object
 */
private Action getPreviousEventAction() {
    Action prevAction = fPrevEventAction;
    if (prevAction == null) {
        Action superPrevAction = getTimeGraphViewer().getPreviousEventAction();
        prevAction = new Action() {

            @Override
            public void run() {
                TimeGraphViewer viewer = getTimeGraphViewer();
                ITimeGraphEntry entry = viewer.getSelection();
                if (entry instanceof TimeGraphEntry) {
                    TimeGraphEntry callStackEntry = (TimeGraphEntry) entry;
                    ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider = getProvider(callStackEntry);
                    long selectionBegin = viewer.getSelectionBegin();
                    SelectionTimeQueryFilter filter = new SelectionTimeQueryFilter(Lists.newArrayList(Long.MIN_VALUE, selectionBegin), Collections.singleton(callStackEntry.getEntryModel().getId()));
                    TmfModelResponse<@NonNull TimeGraphModel> response = provider.fetchRowModel(FetchParametersUtils.selectionTimeQueryToMap(filter), null);
                    TimeGraphModel model = response.getModel();
                    if (model == null || model.getRows().size() != 1) {
                        return;
                    }
                    List<@NonNull ITimeGraphState> row = model.getRows().get(0).getStates();
                    if (row.size() != 1) {
                        return;
                    }
                    ITimeGraphState stackInterval = row.get(0);
                    viewer.setSelectedTimeNotify(stackInterval.getStartTime(), true);
                    int stackLevel = stackInterval.getValue();
                    ITimeGraphEntry selectedEntry = callStackEntry.getParent().getChildren().get(Integer.max(0, stackLevel - 1));
                    viewer.setSelection(selectedEntry, true);
                    viewer.getTimeGraphControl().fireSelectionChanged();
                    startZoomThread(viewer.getTime0(), viewer.getTime1());
                }
            }
        };
        prevAction.setText(superPrevAction.getText());
        prevAction.setToolTipText(superPrevAction.getToolTipText());
        prevAction.setImageDescriptor(superPrevAction.getImageDescriptor());
        fPrevEventAction = prevAction;
    }
    return prevAction;
}
Also used : Action(org.eclipse.jface.action.Action) ITimeGraphDataProvider(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider) TimeGraphModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphModel) TmfModelResponse(org.eclipse.tracecompass.tmf.core.response.TmfModelResponse) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) TimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry) ITimeGraphState(org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphState) SelectionTimeQueryFilter(org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter) ITimeGraphEntry(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) TimeGraphEntryModel(org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel) NonNull(org.eclipse.jdt.annotation.NonNull) Objects.requireNonNull(java.util.Objects.requireNonNull) TimeGraphViewer(org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphViewer) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

TimeGraphEntryModel (org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphEntryModel)29 NonNull (org.eclipse.jdt.annotation.NonNull)16 ArrayList (java.util.ArrayList)12 TmfTreeModel (org.eclipse.tracecompass.tmf.core.model.tree.TmfTreeModel)11 TmfModelResponse (org.eclipse.tracecompass.tmf.core.response.TmfModelResponse)10 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)10 ITimeGraphDataProvider (org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider)8 Element (org.w3c.dom.Element)8 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)7 SelectionTimeQueryFilter (org.eclipse.tracecompass.tmf.core.model.filters.SelectionTimeQueryFilter)7 TmfTraceClosedSignal (org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal)7 Test (org.junit.Test)7 HashMap (java.util.HashMap)6 List (java.util.List)6 ITimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)6 Collection (java.util.Collection)5 TimeQueryFilter (org.eclipse.tracecompass.tmf.core.model.filters.TimeQueryFilter)5 TimeGraphModel (org.eclipse.tracecompass.tmf.core.model.timegraph.TimeGraphModel)5 TimeGraphEntry (org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry)5 Status (org.eclipse.tracecompass.tmf.core.response.ITmfResponse.Status)4