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