Commit | Line | Data |
---|---|---|
be222f56 | 1 | /******************************************************************************* |
4999a196 | 2 | * Copyright (c) 2012, 2013 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 | ||
d3ba47d4 | 16 | import org.eclipse.linuxtools.lttng2.kernel.core.trace.LttngKernelTrace; |
4999a196 | 17 | import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.TimeGraphEntry; |
be222f56 PT |
18 | |
19 | /** | |
20 | * An entry in the Control Flow view | |
21 | */ | |
4999a196 GB |
22 | public class ControlFlowEntry extends TimeGraphEntry { |
23 | ||
be222f56 PT |
24 | private final int fThreadId; |
25 | private final int fParentThreadId; | |
4999a196 | 26 | private final int fThreadQuark; |
be222f56 PT |
27 | |
28 | /** | |
29 | * Constructor | |
30 | * | |
4999a196 | 31 | * @param quark |
be222f56 PT |
32 | * The attribute quark matching the thread |
33 | * @param trace | |
34 | * The trace on which we are working | |
35 | * @param execName | |
36 | * The exec_name of this entry | |
37 | * @param threadId | |
38 | * The TID of the thread | |
39 | * @param parentThreadId | |
40 | * the Parent_TID of this thread | |
be222f56 PT |
41 | * @param startTime |
42 | * The start time of this process's lifetime | |
43 | * @param endTime | |
44 | * The end time of this process | |
45 | */ | |
4999a196 GB |
46 | public ControlFlowEntry(int quark, LttngKernelTrace trace, String execName, int threadId, int parentThreadId, long startTime, long endTime) { |
47 | super(quark, trace, execName, startTime, endTime); | |
be222f56 PT |
48 | fThreadId = threadId; |
49 | fParentThreadId = parentThreadId; | |
4999a196 | 50 | fThreadQuark = quark; |
be222f56 PT |
51 | } |
52 | ||
53 | /** | |
54 | * Get this entry's thread ID | |
55 | * | |
56 | * @return The TID | |
57 | */ | |
58 | public int getThreadId() { | |
59 | return fThreadId; | |
60 | } | |
61 | ||
4999a196 GB |
62 | @Override |
63 | public LttngKernelTrace getTrace() { | |
64 | return (LttngKernelTrace) super.getTrace(); | |
65 | } | |
66 | ||
be222f56 PT |
67 | /** |
68 | * Get this thread's parent TID | |
69 | * | |
70 | * @return The "PTID" | |
71 | */ | |
72 | public int getParentThreadId() { | |
73 | return fParentThreadId; | |
74 | } | |
75 | ||
be222f56 | 76 | /** |
4999a196 | 77 | * Get the quark of the attribute matching this thread's TID |
be222f56 | 78 | * |
4999a196 | 79 | * @return The quark |
be222f56 | 80 | */ |
4999a196 GB |
81 | public int getThreadQuark() { |
82 | return fThreadQuark; | |
be222f56 PT |
83 | } |
84 | ||
be222f56 | 85 | } |