Commit | Line | Data |
---|---|---|
be222f56 | 1 | /******************************************************************************* |
1cf25311 | 2 | * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal |
be222f56 PT |
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 | |
4999a196 | 11 | * Geneviève Bastien - Move code to provide base classes for time graph view |
be222f56 PT |
12 | *******************************************************************************/ |
13 | ||
14 | package org.eclipse.linuxtools.internal.lttng2.kernel.ui.views.controlflow; | |
15 | ||
72221aa4 | 16 | import org.eclipse.jdt.annotation.NonNull; |
1cf25311 | 17 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; |
4999a196 | 18 | import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry; |
be222f56 PT |
19 | |
20 | /** | |
21 | * An entry in the Control Flow view | |
22 | */ | |
4999a196 GB |
23 | public class ControlFlowEntry extends TimeGraphEntry { |
24 | ||
72221aa4 | 25 | private final @NonNull ITmfTrace fTrace; |
be222f56 PT |
26 | private final int fThreadId; |
27 | private final int fParentThreadId; | |
4999a196 | 28 | private final int fThreadQuark; |
be222f56 PT |
29 | |
30 | /** | |
31 | * Constructor | |
32 | * | |
4999a196 | 33 | * @param quark |
be222f56 PT |
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 | |
be222f56 PT |
43 | * @param startTime |
44 | * The start time of this process's lifetime | |
45 | * @param endTime | |
46 | * The end time of this process | |
47 | */ | |
72221aa4 | 48 | public ControlFlowEntry(int quark, @NonNull ITmfTrace trace, String execName, int threadId, int parentThreadId, long startTime, long endTime) { |
1d46dc38 PT |
49 | super(execName, startTime, endTime); |
50 | fTrace = trace; | |
be222f56 PT |
51 | fThreadId = threadId; |
52 | fParentThreadId = parentThreadId; | |
4999a196 | 53 | fThreadQuark = quark; |
be222f56 PT |
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 | ||
1d46dc38 | 65 | /** |
1cf25311 | 66 | * Get the entry's trace |
1d46dc38 | 67 | * |
1cf25311 | 68 | * @return the entry's trace |
1d46dc38 | 69 | */ |
72221aa4 | 70 | public @NonNull ITmfTrace getTrace() { |
1d46dc38 | 71 | return fTrace; |
4999a196 GB |
72 | } |
73 | ||
be222f56 PT |
74 | /** |
75 | * Get this thread's parent TID | |
76 | * | |
77 | * @return The "PTID" | |
78 | */ | |
79 | public int getParentThreadId() { | |
80 | return fParentThreadId; | |
81 | } | |
82 | ||
be222f56 | 83 | /** |
4999a196 | 84 | * Get the quark of the attribute matching this thread's TID |
be222f56 | 85 | * |
4999a196 | 86 | * @return The quark |
be222f56 | 87 | */ |
4999a196 GB |
88 | public int getThreadQuark() { |
89 | return fThreadQuark; | |
be222f56 PT |
90 | } |
91 | ||
b1b156f3 PT |
92 | @Override |
93 | public String toString() { | |
94 | return getClass().getSimpleName() + '(' + getName() + '[' + fThreadId + "])"; //$NON-NLS-1$ | |
95 | } | |
be222f56 | 96 | } |