598deee1c145dcbb75b4fec8f1962dcc8f791b68
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.ui / src / org / eclipse / linuxtools / internal / lttng2 / kernel / ui / views / controlflow / ControlFlowEntry.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 org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
17 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
18
19 /**
20 * An entry in the Control Flow view
21 */
22 public class ControlFlowEntry extends TimeGraphEntry {
23
24 private final ITmfTrace fTrace;
25 private final int fThreadId;
26 private final int fParentThreadId;
27 private final int fThreadQuark;
28
29 /**
30 * Constructor
31 *
32 * @param quark
33 * The attribute quark matching the thread
34 * @param trace
35 * The trace on which we are working
36 * @param execName
37 * The exec_name of this entry
38 * @param threadId
39 * The TID of the thread
40 * @param parentThreadId
41 * the Parent_TID of this thread
42 * @param startTime
43 * The start time of this process's lifetime
44 * @param endTime
45 * The end time of this process
46 */
47 public ControlFlowEntry(int quark, ITmfTrace trace, String execName, int threadId, int parentThreadId, long startTime, long endTime) {
48 super(execName, startTime, endTime);
49 fTrace = trace;
50 fThreadId = threadId;
51 fParentThreadId = parentThreadId;
52 fThreadQuark = quark;
53 }
54
55 /**
56 * Get this entry's thread ID
57 *
58 * @return The TID
59 */
60 public int getThreadId() {
61 return fThreadId;
62 }
63
64 /**
65 * Get the entry's trace
66 *
67 * @return the entry's trace
68 */
69 public ITmfTrace getTrace() {
70 return fTrace;
71 }
72
73 /**
74 * Get this thread's parent TID
75 *
76 * @return The "PTID"
77 */
78 public int getParentThreadId() {
79 return fParentThreadId;
80 }
81
82 /**
83 * Get the quark of the attribute matching this thread's TID
84 *
85 * @return The quark
86 */
87 public int getThreadQuark() {
88 return fThreadQuark;
89 }
90
91 @Override
92 public String toString() {
93 return getClass().getSimpleName() + '(' + getName() + '[' + fThreadId + "])"; //$NON-NLS-1$
94 }
95 }
This page took 0.032133 seconds and 5 git commands to generate.