1 package org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.views
.controlflow2
;
5 import org
.eclipse
.jdt
.annotation
.Nullable
;
6 import org
.eclipse
.tracecompass
.internal
.analysis
.os
.linux
.core
.kernel
.Attributes
;
7 import org
.eclipse
.tracecompass
.internal
.provisional
.tmf
.core
.views
.timegraph2
.TimeGraphTreeElement
;
8 import org
.eclipse
.tracecompass
.internal
.provisional
.tmf
.core
.views
.timegraph2
.statesystem
.StateSystemTimeGraphTreeElement
;
10 public class ControlFlowTreeElement
extends StateSystemTimeGraphTreeElement
{
12 private static final String UNKNOWN_THREAD_NAME
= "???"; //$NON-NLS-1$
14 private final int fTid
;
15 private final String fThreadName
;
17 public ControlFlowTreeElement(String tidStr
, @Nullable String threadName
,
18 List
<TimeGraphTreeElement
> children
, int sourceQuark
) {
19 super(getElementName(tidStr
, threadName
),
23 if (tidStr
.startsWith(Attributes
.THREAD_0_PREFIX
)) {
26 fTid
= Integer
.parseInt(tidStr
);
29 fThreadName
= (threadName
== null ? UNKNOWN_THREAD_NAME
: threadName
);
32 private static String
getElementName(String tidStr
, @Nullable String threadName
) {
33 String tidPart
= tidStr
;
34 if (tidPart
.startsWith(Attributes
.THREAD_0_PREFIX
)) {
35 /* Display "0/0" instead of "0_0" */
36 tidPart
= tidPart
.replace('_', '/');
39 String threadNamePart
= (threadName
== null ? UNKNOWN_THREAD_NAME
: threadName
);
40 return (tidPart
+ " - " + threadNamePart
); //$NON-NLS-1$
47 public String
getThreadName() {