12da4aedf069cb661fa70323a639db8110585130
1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.controlflow
;
15 import java
.util
.Iterator
;
16 import java
.util
.LinkedList
;
17 import java
.util
.List
;
19 import org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.trace
.CtfKernelTrace
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
21 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
23 public class ControlFlowEntry
implements ITimeGraphEntry
, Comparable
<ControlFlowEntry
> {
24 private CtfKernelTrace fTrace
;
25 private ITimeGraphEntry parent
= null;
26 private ITimeGraphEntry
[] children
= null;
28 private int fThreadId
;
30 private long fStartTime
= -1;
31 private long fEndTime
= -1;
32 List
<ITimeEvent
> list
= new LinkedList
<ITimeEvent
>();
34 public ControlFlowEntry(CtfKernelTrace trace
, String execName
, int threadId
, int ppid
, long startTime
, long endTime
) {
39 fStartTime
= startTime
;
44 public ITimeGraphEntry
getParent() {
49 public boolean hasChildren() {
50 return children
!= null && children
.length
> 0;
54 public ITimeGraphEntry
[] getChildren() {
59 public String
getName() {
63 public int getThreadId() {
67 public int getPPID() {
72 public long getStartTime() {
77 public long getStopTime() {
82 public Iterator
<ITimeEvent
> getTimeEventsIterator() {
83 return list
.iterator();
87 public Iterator
<ITimeEvent
> getTimeEventsIterator(long startTime
, long stopTime
, long visibleDuration
) {
88 return getTimeEventsIterator();
91 public void addTraceEvent(ITimeEvent event
) {
92 long time
= event
.getTime();
94 if (fStartTime
== -1 || time
< fStartTime
) {
97 if (fEndTime
== -1 || time
> fEndTime
) {
103 public int compareTo(ControlFlowEntry other
) {
104 int result
= this.fThreadId
< other
.fThreadId ?
-1 : this.fThreadId
> other
.fThreadId ?
1 : 0;
106 result
= this.fStartTime
< other
.fStartTime ?
-1 : this.fStartTime
> other
.fStartTime ?
1 : 0;
This page took 0.032081 seconds and 5 git commands to generate.