TMF: Add some @NonNull annotations to the AbstractTimeGraphView
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.kernel.ui / src / org / eclipse / tracecompass / internal / lttng2 / kernel / ui / views / controlflow / ControlFlowView.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Patrick Tasse - Initial API and implementation
11 * Geneviève Bastien - Move code to provide base classes for time graph view
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.internal.lttng2.kernel.ui.views.controlflow;
15
16 import java.util.ArrayList;
17 import java.util.Comparator;
18 import java.util.HashMap;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.eclipse.core.runtime.IProgressMonitor;
23 import org.eclipse.jdt.annotation.NonNull;
24 import org.eclipse.jdt.annotation.Nullable;
25 import org.eclipse.jface.action.IAction;
26 import org.eclipse.jface.action.IToolBarManager;
27 import org.eclipse.jface.dialogs.IDialogSettings;
28 import org.eclipse.tracecompass.internal.lttng2.kernel.core.Attributes;
29 import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Activator;
30 import org.eclipse.tracecompass.internal.lttng2.kernel.ui.Messages;
31 import org.eclipse.tracecompass.lttng2.kernel.core.analysis.kernel.LttngKernelAnalysis;
32 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
33 import org.eclipse.tracecompass.statesystem.core.StateSystemUtils;
34 import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
35 import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
36 import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
37 import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
38 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
39 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
40 import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
41 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
42 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
43 import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
44 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ILinkEvent;
45 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
46 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
47 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeEvent;
48 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
49 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeLinkEvent;
50 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
51 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.Resolution;
52 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
53
54 /**
55 * The Control Flow view main object
56 *
57 */
58 public class ControlFlowView extends AbstractTimeGraphView {
59
60 // ------------------------------------------------------------------------
61 // Constants
62 // ------------------------------------------------------------------------
63
64 /**
65 * View ID.
66 */
67 public static final String ID = "org.eclipse.linuxtools.lttng2.kernel.ui.views.controlflow"; //$NON-NLS-1$
68
69 private static final String PROCESS_COLUMN = Messages.ControlFlowView_processColumn;
70 private static final String TID_COLUMN = Messages.ControlFlowView_tidColumn;
71 private static final String PTID_COLUMN = Messages.ControlFlowView_ptidColumn;
72 private static final String BIRTH_TIME_COLUMN = Messages.ControlFlowView_birthTimeColumn;
73 private static final String TRACE_COLUMN = Messages.ControlFlowView_traceColumn;
74
75 private static final String[] COLUMN_NAMES = new String[] {
76 PROCESS_COLUMN,
77 TID_COLUMN,
78 PTID_COLUMN,
79 BIRTH_TIME_COLUMN,
80 TRACE_COLUMN
81 };
82
83 private static final String[] FILTER_COLUMN_NAMES = new String[] {
84 PROCESS_COLUMN,
85 TID_COLUMN
86 };
87
88 // Timeout between updates in the build thread in ms
89 private static final long BUILD_UPDATE_TIMEOUT = 500;
90
91 // ------------------------------------------------------------------------
92 // Constructors
93 // ------------------------------------------------------------------------
94
95 /**
96 * Constructor
97 */
98 public ControlFlowView() {
99 super(ID, new ControlFlowPresentationProvider());
100 setTreeColumns(COLUMN_NAMES);
101 setTreeLabelProvider(new ControlFlowTreeLabelProvider());
102 setFilterColumns(FILTER_COLUMN_NAMES);
103 setFilterLabelProvider(new ControlFlowFilterLabelProvider());
104 setEntryComparator(new ControlFlowEntryComparator());
105 }
106
107 @Override
108 protected void fillLocalToolBar(IToolBarManager manager) {
109 super.fillLocalToolBar(manager);
110 IDialogSettings settings = Activator.getDefault().getDialogSettings();
111 IDialogSettings section = settings.getSection(getClass().getName());
112 if (section == null) {
113 section = settings.addNewSection(getClass().getName());
114 }
115
116 IAction hideArrowsAction = getTimeGraphCombo().getTimeGraphViewer().getHideArrowsAction(section);
117 manager.add(hideArrowsAction);
118
119 IAction followArrowBwdAction = getTimeGraphCombo().getTimeGraphViewer().getFollowArrowBwdAction();
120 followArrowBwdAction.setText(Messages.ControlFlowView_followCPUBwdText);
121 followArrowBwdAction.setToolTipText(Messages.ControlFlowView_followCPUBwdText);
122 manager.add(followArrowBwdAction);
123
124 IAction followArrowFwdAction = getTimeGraphCombo().getTimeGraphViewer().getFollowArrowFwdAction();
125 followArrowFwdAction.setText(Messages.ControlFlowView_followCPUFwdText);
126 followArrowFwdAction.setToolTipText(Messages.ControlFlowView_followCPUFwdText);
127 manager.add(followArrowFwdAction);
128 }
129
130 @Override
131 protected String getNextText() {
132 return Messages.ControlFlowView_nextProcessActionNameText;
133 }
134
135 @Override
136 protected String getNextTooltip() {
137 return Messages.ControlFlowView_nextProcessActionToolTipText;
138 }
139
140 @Override
141 protected String getPrevText() {
142 return Messages.ControlFlowView_previousProcessActionNameText;
143 }
144
145 @Override
146 protected String getPrevTooltip() {
147 return Messages.ControlFlowView_previousProcessActionToolTipText;
148 }
149
150 private static class ControlFlowEntryComparator implements Comparator<ITimeGraphEntry> {
151
152 @Override
153 public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
154
155 int result = 0;
156
157 if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) {
158 ControlFlowEntry entry1 = (ControlFlowEntry) o1;
159 ControlFlowEntry entry2 = (ControlFlowEntry) o2;
160 result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime());
161 if (result == 0) {
162 result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName());
163 }
164 if (result == 0) {
165 result = entry1.getThreadId() < entry2.getThreadId() ? -1 : entry1.getThreadId() > entry2.getThreadId() ? 1 : 0;
166 }
167 }
168
169 if (result == 0) {
170 result = o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0;
171 }
172
173 return result;
174 }
175 }
176
177 /**
178 * @author gbastien
179 *
180 */
181 protected static class ControlFlowTreeLabelProvider extends TreeLabelProvider {
182
183 @Override
184 public String getColumnText(Object element, int columnIndex) {
185 ControlFlowEntry entry = (ControlFlowEntry) element;
186
187 if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_processColumn)) {
188 return entry.getName();
189 } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_tidColumn)) {
190 return Integer.toString(entry.getThreadId());
191 } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_ptidColumn)) {
192 if (entry.getParentThreadId() > 0) {
193 return Integer.toString(entry.getParentThreadId());
194 }
195 } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_birthTimeColumn)) {
196 return Utils.formatTime(entry.getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC);
197 } else if (COLUMN_NAMES[columnIndex].equals(Messages.ControlFlowView_traceColumn)) {
198 return entry.getTrace().getName();
199 }
200 return ""; //$NON-NLS-1$
201 }
202
203 }
204
205 private static class ControlFlowFilterLabelProvider extends TreeLabelProvider {
206
207 @Override
208 public String getColumnText(Object element, int columnIndex) {
209 ControlFlowEntry entry = (ControlFlowEntry) element;
210
211 if (columnIndex == 0) {
212 return entry.getName();
213 } else if (columnIndex == 1) {
214 return Integer.toString(entry.getThreadId());
215 }
216 return ""; //$NON-NLS-1$
217 }
218
219 }
220
221 // ------------------------------------------------------------------------
222 // Internal
223 // ------------------------------------------------------------------------
224
225 @Override
226 protected void buildEventList(final ITmfTrace trace, ITmfTrace parentTrace, IProgressMonitor monitor) {
227 ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
228 if (ssq == null) {
229 return;
230 }
231
232 List<ControlFlowEntry> entryList = new ArrayList<>();
233 Map<Integer, ControlFlowEntry> entryMap = new HashMap<>();
234
235 long start = ssq.getStartTime();
236 setStartTime(Math.min(getStartTime(), start));
237
238 boolean complete = false;
239 while (!complete) {
240 if (monitor.isCanceled()) {
241 return;
242 }
243 complete = ssq.waitUntilBuilt(BUILD_UPDATE_TIMEOUT);
244 if (ssq.isCancelled()) {
245 return;
246 }
247 long end = ssq.getCurrentEndTime();
248 if (start == end && !complete) { // when complete execute one last time regardless of end time
249 continue;
250 }
251 setEndTime(Math.max(getEndTime(), end + 1));
252 List<Integer> threadQuarks = ssq.getQuarks(Attributes.THREADS, "*"); //$NON-NLS-1$
253 for (int threadQuark : threadQuarks) {
254 if (monitor.isCanceled()) {
255 return;
256 }
257 String threadName = ssq.getAttributeName(threadQuark);
258 int threadId = -1;
259 try {
260 threadId = Integer.parseInt(threadName);
261 } catch (NumberFormatException e1) {
262 continue;
263 }
264 if (threadId <= 0) { // ignore the 'unknown' (-1) and swapper (0) threads
265 continue;
266 }
267
268 int execNameQuark;
269 List<ITmfStateInterval> execNameIntervals;
270 try {
271 execNameQuark = ssq.getQuarkRelative(threadQuark, Attributes.EXEC_NAME);
272 execNameIntervals = StateSystemUtils.queryHistoryRange(ssq, execNameQuark, start, end);
273 } catch (AttributeNotFoundException e) {
274 /* No information on this thread (yet?), skip it for now */
275 continue;
276 } catch (StateSystemDisposedException e) {
277 /* State system is closing down, no point continuing */
278 break;
279 }
280
281 for (ITmfStateInterval execNameInterval : execNameIntervals) {
282 if (monitor.isCanceled()) {
283 return;
284 }
285 ControlFlowEntry entry = entryMap.get(threadId);
286 if (!execNameInterval.getStateValue().isNull() &&
287 execNameInterval.getStateValue().getType() == ITmfStateValue.Type.STRING) {
288 String execName = execNameInterval.getStateValue().unboxStr();
289 long startTime = execNameInterval.getStartTime();
290 long endTime = execNameInterval.getEndTime() + 1;
291
292 if (entry == null) {
293 ITmfStateInterval ppidInterval = null;
294 try {
295 int ppidQuark = ssq.getQuarkRelative(threadQuark, Attributes.PPID);
296 ppidInterval = StateSystemUtils.queryUntilNonNullValue(ssq, ppidQuark, startTime, endTime);
297 } catch (AttributeNotFoundException e) {
298 /* No info, keep PPID at -1 */
299 }
300
301 int ppid = -1;
302 if (ppidInterval != null) {
303 ppid = ppidInterval.getStateValue().unboxInt();
304 }
305 entry = new ControlFlowEntry(threadQuark, trace, execName, threadId, ppid, startTime, endTime);
306 entryList.add(entry);
307 entryMap.put(threadId, entry);
308 } else {
309 // update the name of the entry to the latest
310 // execName
311 entry.setName(execName);
312 entry.updateEndTime(endTime);
313 }
314 } else {
315 entryMap.remove(threadId);
316 }
317 }
318 }
319
320 updateTree(entryList, parentTrace);
321
322 if (parentTrace.equals(getTrace())) {
323 refresh();
324 }
325
326 for (ControlFlowEntry entry : entryList) {
327 if (monitor.isCanceled()) {
328 return;
329 }
330 buildStatusEvents(entry.getTrace(), entry, monitor, start, end);
331 }
332
333 start = end;
334 }
335 }
336
337 private void updateTree(List<ControlFlowEntry> entryList, ITmfTrace parentTrace) {
338 List<TimeGraphEntry> rootListToAdd = new ArrayList<>();
339 List<TimeGraphEntry> rootListToRemove = new ArrayList<>();
340 List<TimeGraphEntry> rootList = getEntryList(parentTrace);
341
342 for (ControlFlowEntry entry : entryList) {
343 boolean root = (entry.getParent() == null);
344 if (root && entry.getParentThreadId() > 0) {
345 for (ControlFlowEntry parent : entryList) {
346 /*
347 * Associate the parent entry only if their time overlap. A
348 * child entry may start before its parent, for example at
349 * the beginning of the trace if a parent has not yet
350 * appeared in the state system. We just want to make sure
351 * that the entry didn't start after the parent ended or
352 * ended before the parent started.
353 */
354 if (parent.getThreadId() == entry.getParentThreadId() &&
355 !(entry.getStartTime() > parent.getEndTime() ||
356 entry.getEndTime() < parent.getStartTime())) {
357 parent.addChild(entry);
358 root = false;
359 if (rootList != null && rootList.contains(entry)) {
360 rootListToRemove.add(entry);
361 }
362 break;
363 }
364 }
365 }
366 if (root && (rootList == null || !rootList.contains(entry))) {
367 rootListToAdd.add(entry);
368 }
369 }
370
371 addToEntryList(parentTrace, rootListToAdd);
372 removeFromEntryList(parentTrace, rootListToRemove);
373 }
374
375 private void buildStatusEvents(ITmfTrace trace, ControlFlowEntry entry, @NonNull IProgressMonitor monitor, long start, long end) {
376 if (start < entry.getEndTime() && end > entry.getStartTime()) {
377 ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
378 if (ssq == null) {
379 return;
380 }
381
382 long startTime = Math.max(start, entry.getStartTime());
383 long endTime = Math.min(end + 1, entry.getEndTime());
384 long resolution = Math.max(1, (end - ssq.getStartTime()) / getDisplayWidth());
385 List<ITimeEvent> eventList = getEventList(entry, startTime, endTime, resolution, monitor);
386 if (eventList == null) {
387 return;
388 }
389 for (ITimeEvent event : eventList) {
390 entry.addEvent(event);
391 }
392 if (trace.equals(getTrace())) {
393 redraw();
394 }
395 }
396 for (ITimeGraphEntry child : entry.getChildren()) {
397 if (monitor.isCanceled()) {
398 return;
399 }
400 buildStatusEvents(trace, (ControlFlowEntry) child, monitor, start, end);
401 }
402 }
403
404 @Override
405 protected @Nullable List<ITimeEvent> getEventList(TimeGraphEntry tgentry, long startTime, long endTime, long resolution, IProgressMonitor monitor) {
406 List<ITimeEvent> eventList = null;
407 if (!(tgentry instanceof ControlFlowEntry)) {
408 return eventList;
409 }
410 ControlFlowEntry entry = (ControlFlowEntry) tgentry;
411 final long realStart = Math.max(startTime, entry.getStartTime());
412 final long realEnd = Math.min(endTime, entry.getEndTime());
413 if (realEnd <= realStart) {
414 return null;
415 }
416 ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(entry.getTrace(), LttngKernelAnalysis.ID);
417 if (ssq == null) {
418 return null;
419 }
420 try {
421 int statusQuark = ssq.getQuarkRelative(entry.getThreadQuark(), Attributes.STATUS);
422 List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ssq, statusQuark, realStart, realEnd - 1, resolution, monitor);
423 eventList = new ArrayList<>(statusIntervals.size());
424 long lastEndTime = -1;
425 for (ITmfStateInterval statusInterval : statusIntervals) {
426 if (monitor.isCanceled()) {
427 return null;
428 }
429 long time = statusInterval.getStartTime();
430 long duration = statusInterval.getEndTime() - time + 1;
431 int status = -1;
432 try {
433 status = statusInterval.getStateValue().unboxInt();
434 } catch (StateValueTypeException e) {
435 e.printStackTrace();
436 }
437 if (lastEndTime != time && lastEndTime != -1) {
438 eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
439 }
440 eventList.add(new TimeEvent(entry, time, duration, status));
441 lastEndTime = time + duration;
442 }
443 } catch (AttributeNotFoundException | TimeRangeException e) {
444 e.printStackTrace();
445 } catch (StateSystemDisposedException e) {
446 /* Ignored */
447 }
448 return eventList;
449 }
450
451 /**
452 * Returns a value corresponding to the selected entry.
453 *
454 * Used in conjunction with synchingToTime to change the selected entry. If
455 * one of these methods is overridden in child class, then both should be.
456 *
457 * @param time
458 * The currently selected time
459 * @return a value identifying the entry
460 */
461 private int getSelectionValue(long time) {
462 int thread = -1;
463 ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace());
464 if (traces == null) {
465 return thread;
466 }
467 for (ITmfTrace trace : traces) {
468 if (thread > 0) {
469 break;
470 }
471 if (trace == null) {
472 continue;
473 }
474 ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
475 if (ssq == null) {
476 continue;
477 }
478 if (time >= ssq.getStartTime() && time <= ssq.getCurrentEndTime()) {
479 List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); //$NON-NLS-1$
480 for (int currentThreadQuark : currentThreadQuarks) {
481 try {
482 ITmfStateInterval currentThreadInterval = ssq.querySingleState(time, currentThreadQuark);
483 int currentThread = currentThreadInterval.getStateValue().unboxInt();
484 if (currentThread > 0) {
485 int statusQuark = ssq.getQuarkAbsolute(Attributes.THREADS, Integer.toString(currentThread), Attributes.STATUS);
486 ITmfStateInterval statusInterval = ssq.querySingleState(time, statusQuark);
487 if (statusInterval.getStartTime() == time) {
488 thread = currentThread;
489 break;
490 }
491 }
492 } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
493 e.printStackTrace();
494 } catch (StateSystemDisposedException e) {
495 /* Ignored */
496 }
497 }
498 }
499 }
500 return thread;
501 }
502
503 @Override
504 protected void synchingToTime(long time) {
505 int selected = getSelectionValue(time);
506 if (selected > 0) {
507 for (Object element : getTimeGraphViewer().getExpandedElements()) {
508 if (element instanceof ControlFlowEntry) {
509 ControlFlowEntry entry = (ControlFlowEntry) element;
510 if (entry.getThreadId() == selected) {
511 getTimeGraphCombo().setSelection(entry);
512 break;
513 }
514 }
515 }
516 }
517 }
518
519 @Override
520 protected List<ILinkEvent> getLinkList(long startTime, long endTime, long resolution, IProgressMonitor monitor) {
521 List<ILinkEvent> list = new ArrayList<>();
522 ITmfTrace[] traces = TmfTraceManager.getTraceSet(getTrace());
523 List<TimeGraphEntry> entryList = getEntryList(getTrace());
524 if (traces == null || entryList == null) {
525 return list;
526 }
527 for (ITmfTrace trace : traces) {
528 if (trace == null) {
529 continue;
530 }
531 ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, LttngKernelAnalysis.ID);
532 if (ssq == null) {
533 continue;
534 }
535 try {
536 long start = Math.max(startTime, ssq.getStartTime());
537 long end = Math.min(endTime, ssq.getCurrentEndTime());
538 if (end < start) {
539 continue;
540 }
541 List<Integer> currentThreadQuarks = ssq.getQuarks(Attributes.CPUS, "*", Attributes.CURRENT_THREAD); //$NON-NLS-1$
542 for (int currentThreadQuark : currentThreadQuarks) {
543 // adjust the query range to include the previous and following intervals
544 long qstart = Math.max(ssq.querySingleState(start, currentThreadQuark).getStartTime() - 1, ssq.getStartTime());
545 long qend = Math.min(ssq.querySingleState(end, currentThreadQuark).getEndTime() + 1, ssq.getCurrentEndTime());
546 List<ITmfStateInterval> currentThreadIntervals = StateSystemUtils.queryHistoryRange(ssq, currentThreadQuark, qstart, qend, resolution, monitor);
547 int prevThread = 0;
548 long prevEnd = 0;
549 long lastEnd = 0;
550 for (ITmfStateInterval currentThreadInterval : currentThreadIntervals) {
551 if (monitor.isCanceled()) {
552 return null;
553 }
554 long time = currentThreadInterval.getStartTime();
555 if (time != lastEnd) {
556 // don't create links where there are gaps in intervals due to the resolution
557 prevThread = 0;
558 prevEnd = 0;
559 }
560 int thread = currentThreadInterval.getStateValue().unboxInt();
561 if (thread > 0 && prevThread > 0) {
562 ITimeGraphEntry prevEntry = findEntry(entryList, trace, prevThread);
563 ITimeGraphEntry nextEntry = findEntry(entryList, trace, thread);
564 list.add(new TimeLinkEvent(prevEntry, nextEntry, prevEnd, time - prevEnd, 0));
565 }
566 lastEnd = currentThreadInterval.getEndTime() + 1;
567 if (thread != 0) {
568 prevThread = thread;
569 prevEnd = lastEnd;
570 }
571 }
572 }
573 } catch (TimeRangeException | AttributeNotFoundException | StateValueTypeException e) {
574 e.printStackTrace();
575 } catch (StateSystemDisposedException e) {
576 /* Ignored */
577 }
578 }
579 return list;
580 }
581
582 private ControlFlowEntry findEntry(List<? extends ITimeGraphEntry> entryList, ITmfTrace trace, int threadId) {
583 for (ITimeGraphEntry entry : entryList) {
584 if (entry instanceof ControlFlowEntry) {
585 ControlFlowEntry controlFlowEntry = (ControlFlowEntry) entry;
586 if (controlFlowEntry.getThreadId() == threadId && controlFlowEntry.getTrace() == trace) {
587 return controlFlowEntry;
588 } else if (entry.hasChildren()) {
589 controlFlowEntry = findEntry(entry.getChildren(), trace, threadId);
590 if (controlFlowEntry != null) {
591 return controlFlowEntry;
592 }
593 }
594 }
595 }
596 return null;
597 }
598 }
This page took 0.047002 seconds and 6 git commands to generate.