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