74a5f5dee693d1be73ec296aa00c1fa2e7da3e68
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 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
.tracecompass
.tmf
.ui
.views
.callstack
;
15 import java
.util
.regex
.Pattern
;
17 import org
.eclipse
.jdt
.annotation
.NonNull
;
18 import org
.eclipse
.tracecompass
.statesystem
.core
.ITmfStateSystem
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.TimeGraphEntry
;
23 * An entry, or row, in the Call Stack view
25 * @author Patrick Tasse
27 public class CallStackEntry
extends TimeGraphEntry
{
29 private final int fQuark
;
30 private final int fStackLevel
;
31 private final int fProcessId
;
32 private final ITmfTrace fTrace
;
33 private String fFunctionName
;
34 private long fFunctionEntryTime
;
35 private long fFunctionExitTime
;
36 private @NonNull ITmfStateSystem fSS
;
39 * Standard constructor
42 * The call stack quark
46 * The trace that this view is talking about
47 * @deprecated Use {@link #CallStackEntry(String, int, int, int, ITmfTrace, ITmfStateSystem)}
50 public CallStackEntry(int quark
, int stackLevel
, ITmfTrace trace
) {
52 throw new UnsupportedOperationException();
56 * Standard constructor
59 * The parent thread name
61 * The call stack quark
65 * The trace that this view is talking about
67 * The call stack state system
69 * {@link #CallStackEntry(String, int, int, int, ITmfTrace, ITmfStateSystem)}
72 public CallStackEntry(String name
, int quark
, int stackLevel
, ITmfTrace trace
, @NonNull ITmfStateSystem ss
) {
75 fStackLevel
= stackLevel
;
78 fFunctionName
= ""; //$NON-NLS-1$
83 * Standard constructor
86 * The parent thread name
88 * The call stack quark
91 * @param processId The ID of the process this entry belongs to
93 * The trace that this view is talking about
95 * The call stack state system
98 public CallStackEntry(String name
, int quark
, int stackLevel
, int processId
,
99 ITmfTrace trace
, @NonNull ITmfStateSystem ss
) {
102 fStackLevel
= stackLevel
;
103 fProcessId
= processId
;
105 fFunctionName
= ""; //$NON-NLS-1$
110 * Get the function name of the call stack entry
111 * @return the function name
113 public String
getFunctionName() {
114 return fFunctionName
;
118 * Set the function name of the call stack entry
119 * @param functionName the function name
121 public void setFunctionName(String functionName
) {
122 fFunctionName
= functionName
;
126 * Set the start time of the call stack entry
127 * @param startTime the start time
128 * @deprecated Use {@link #setFunctionEntryTime(long)}
131 public void setStartTime(long startTime
) {
132 throw new UnsupportedOperationException();
136 * Set the end time of the call stack entry
137 * @param endTime the end time
138 * @deprecated Use {@link #setFunctionExitTime(long)}
141 public void setEndTime(long endTime
) {
142 throw new UnsupportedOperationException();
146 * Set the selected function entry time
149 * the function entry time
151 public void setFunctionEntryTime(long entryTime
) {
152 fFunctionEntryTime
= entryTime
;
156 * Get the selected function entry time
158 * @return the function entry time
160 public long getFunctionEntryTime() {
161 return fFunctionEntryTime
;
165 * Set the selected function exit time
168 * the function exit time
170 public void setFunctionExitTime(long exitTime
) {
171 fFunctionExitTime
= exitTime
;
175 * Get the selected function exit time
177 * @return the function exit time
179 public long getFunctionExitTime() {
180 return fFunctionExitTime
;
184 * Retrieve the attribute quark that's represented by this entry.
186 * @return The integer quark
188 public int getQuark() {
193 * Retrieve the stack level associated with this entry.
195 * @return The stack level or 0
197 public int getStackLevel() {
202 * Retrieve the ID of the process this entry belongs to.
204 * @return The ID of the process
207 public int getProcessId() {
212 * Retrieve the trace that is associated to this view.
216 public ITmfTrace
getTrace() {
221 * Retrieve the call stack state system associated with this entry.
223 * @return The call stack state system
225 public @NonNull ITmfStateSystem
getStateSystem() {
230 public boolean matches(@NonNull Pattern pattern
) {
231 return pattern
.matcher(fFunctionName
).find();
This page took 0.03683 seconds and 4 git commands to generate.