1b7a09b1703e03513ee5bff223e8a4435641defd
1 /*******************************************************************************
2 * Copyright (c) 2012, 2016 Ericsson, École Polytechnique de Montréal
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 * Geneviève Bastien - Move code to provide base classes for time graph view
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.analysis
.os
.linux
.ui
.views
.controlflow
;
16 import java
.util
.regex
.Pattern
;
18 import org
.eclipse
.jdt
.annotation
.NonNull
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.TimeGraphEntry
;
21 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.Utils
;
22 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.Utils
.Resolution
;
23 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.Utils
.TimeFormat
;
26 * An entry in the Control Flow view
28 public class ControlFlowEntry
extends TimeGraphEntry
{
30 private final @NonNull ITmfTrace fTrace
;
31 private final int fThreadId
;
32 private int fParentThreadId
;
33 private final int fThreadQuark
;
39 * The attribute quark matching the thread
41 * The trace on which we are working
43 * The exec_name of this entry
45 * The TID of the thread
46 * @param parentThreadId
47 * the Parent_TID of this thread
49 * The start time of this process's lifetime
51 * The end time of this process
53 public ControlFlowEntry(int quark
, @NonNull ITmfTrace trace
, String execName
, int threadId
, int parentThreadId
, long startTime
, long endTime
) {
54 super(execName
, startTime
, endTime
);
57 fParentThreadId
= parentThreadId
;
62 * Get this entry's thread ID
66 public int getThreadId() {
71 * Get the entry's trace
73 * @return the entry's trace
75 public @NonNull ITmfTrace
getTrace() {
80 * Get this thread's parent TID
84 public int getParentThreadId() {
85 return fParentThreadId
;
89 * Set this thread's parent TID
95 public void setParentThreadId(int ptid
) {
96 fParentThreadId
= ptid
;
100 * Get the quark of the attribute matching this thread's TID
104 public int getThreadQuark() {
109 public boolean matches(@NonNull Pattern pattern
) {
110 if (pattern
.matcher(getName()).find()) {
113 if (pattern
.matcher(Integer
.toString(fThreadId
)).find()) {
116 if (pattern
.matcher(Integer
.toString(fParentThreadId
)).find()) {
119 if (pattern
.matcher(Integer
.toString(fThreadQuark
)).find()) {
122 if (pattern
.matcher(Utils
.formatTime(getStartTime(), TimeFormat
.CALENDAR
, Resolution
.NANOSEC
)).find()) {
125 return pattern
.matcher(fTrace
.getName()).find();
129 public String
toString() {
130 return getClass().getSimpleName() + '(' + getName() + '[' + fThreadId
+ "])"; //$NON-NLS-1$
This page took 0.035722 seconds and 4 git commands to generate.