private final CtfKernelTrace fTrace;
private ControlFlowEntry fParent = null;
private final ArrayList<ControlFlowEntry> fChildren = new ArrayList<ControlFlowEntry>();
- private final String fName;
+ private String fName;
private final int fThreadId;
private final int fParentThreadId;
- private long fBirthTime = -1;
private long fStartTime = -1;
private long fEndTime = -1;
private List<ITimeEvent> fEventList = new ArrayList<ITimeEvent>();
* The TID of the thread
* @param parentThreadId
* the Parent_TID of this thread
- * @param birthTime
- * The birth time of this entry (this allows separating different
- * process that could have the same TID)
* @param startTime
* The start time of this process's lifetime
* @param endTime
* The end time of this process
*/
- public ControlFlowEntry(int threadQuark, CtfKernelTrace trace, String execName, int threadId, int parentThreadId, long birthTime, long startTime, long endTime) {
+ public ControlFlowEntry(int threadQuark, CtfKernelTrace trace, String execName, int threadId, int parentThreadId, long startTime, long endTime) {
fThreadQuark = threadQuark;
fTrace = trace;
fName = execName;
fThreadId = threadId;
fParentThreadId = parentThreadId;
- fBirthTime = birthTime;
fStartTime = startTime;
fEndTime = endTime;
}
return fName;
}
+ /**
+ * Update the entry name
+ * @param execName the updated entry name
+ */
+ public void setName(String execName) {
+ fName = execName;
+ }
+
@Override
public long getStartTime() {
return fStartTime;
return fParentThreadId;
}
- /**
- * Get the birth time of this entry/process
- *
- * @return The birth time
- */
- public long getBirthTime() {
- return fBirthTime;
- }
-
/**
* Add an event to this process's timeline
*
return Integer.toString(entry.getParentThreadId());
}
} else if (columnIndex == 3) {
- return Utils.formatTime(entry.getBirthTime(), TimeFormat.CALENDAR, Resolution.NANOSEC);
+ return Utils.formatTime(entry.getStartTime(), TimeFormat.CALENDAR, Resolution.NANOSEC);
} else if (columnIndex == 4) {
return entry.getTrace().getName();
}
if (monitor.isCanceled()) {
return;
}
- long birthTime = -1;
+ ControlFlowEntry entry = null;
for (ITmfStateInterval execNameInterval : execNameIntervals) {
if (monitor.isCanceled()) {
return;
String execName = execNameInterval.getStateValue().unboxStr();
long startTime = execNameInterval.getStartTime();
long endTime = execNameInterval.getEndTime() + 1;
- if (birthTime == -1) {
- birthTime = startTime;
- }
int ppid = -1;
if (ppidQuark != -1) {
ITmfStateInterval ppidInterval = ssq.querySingleState(startTime, ppidQuark);
ppid = ppidInterval.getStateValue().unboxInt();
}
- ControlFlowEntry entry = new ControlFlowEntry(threadQuark, ctfKernelTrace, execName, threadId, ppid, birthTime, startTime, endTime);
- entryList.add(entry);
+ if (entry == null) {
+ entry = new ControlFlowEntry(threadQuark, ctfKernelTrace, execName, threadId, ppid, startTime, endTime);
+ entryList.add(entry);
+ } else {
+ // update the name of the entry to the latest execName
+ entry.setName(execName);
+ }
entry.addEvent(new TimeEvent(entry, startTime, endTime - startTime));
} else {
- birthTime = -1;
+ entry = null;
}
}
} catch (AttributeNotFoundException e) {