The full event list should be recomputed for the full range at every
iteration of the build thread. If built incrementally it can create too
many events in the full event list.
The build thread should not insert NullTimeEvent in the full event list.
Change-Id: I2523291197b2d93267b2aa799e6126ea74eea0f9
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/70519
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
final long resolution = Math.max(1, (end - ssq.getStartTime()) / getDisplayWidth());
setEndTime(Math.max(getEndTime(), end + 1));
final List<Integer> threadQuarks = ssq.getQuarks(Attributes.THREADS, "*"); //$NON-NLS-1$
final long resolution = Math.max(1, (end - ssq.getStartTime()) / getDisplayWidth());
setEndTime(Math.max(getEndTime(), end + 1));
final List<Integer> threadQuarks = ssq.getQuarks(Attributes.THREADS, "*"); //$NON-NLS-1$
- final long qStart = start;
- final long qEnd = end;
- queryFullStates(ssq, qStart, qEnd, resolution, monitor, new IQueryHandler() {
+ queryFullStates(ssq, start, end, resolution, monitor, new IQueryHandler() {
@Override
public void handle(List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState) {
for (int threadQuark : threadQuarks) {
@Override
public void handle(List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState) {
for (int threadQuark : threadQuarks) {
}
}
updateTree(entryList, parentTrace, ssq);
}
}
updateTree(entryList, parentTrace, ssq);
+ queryFullStates(ssq, ssq.getStartTime(), end, resolution, monitor, new IQueryHandler() {
+ @Override
+ public void handle(@NonNull List<List<ITmfStateInterval>> fullStates, @Nullable List<ITmfStateInterval> prevFullState) {
for (final TimeGraphEntry entry : getEntryList(ssq)) {
if (monitor.isCanceled()) {
return;
}
for (final TimeGraphEntry entry : getEntryList(ssq)) {
if (monitor.isCanceled()) {
return;
}
- buildStatusEvents(trace, parentTrace, ssq, fullStates, prevFullState, (ControlFlowEntry) entry, monitor, qStart, qEnd);
+ buildStatusEvents(trace, parentTrace, ssq, fullStates, prevFullState, (ControlFlowEntry) entry, monitor, ssq.getStartTime(), end);
if (eventList == null) {
return;
}
if (eventList == null) {
return;
}
- for (ITimeEvent event : eventList) {
- entry.addEvent(event);
+ /* Start a new event list on first iteration, then append to it */
+ if (prevFullState == null) {
+ entry.setEventList(eventList);
+ } else {
+ for (ITimeEvent event : eventList) {
+ entry.addEvent(event);
+ }
}
if (parentTrace.equals(getTrace())) {
redraw();
}
if (parentTrace.equals(getTrace())) {
redraw();
}
final List<@NonNull TimeGraphEntry> traceEntryChildren = traceEntry.getChildren();
final long resolution = Math.max(1, (endTime - ssq.getStartTime()) / getDisplayWidth());
}
final List<@NonNull TimeGraphEntry> traceEntryChildren = traceEntry.getChildren();
final long resolution = Math.max(1, (endTime - ssq.getStartTime()) / getDisplayWidth());
- final long qStart = start;
- final long qEnd = end;
- queryFullStates(ssq, qStart, qEnd, resolution, monitor, new IQueryHandler() {
+ queryFullStates(ssq, ssq.getStartTime(), end, resolution, monitor, new IQueryHandler() {
@Override
public void handle(List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState) {
for (TimeGraphEntry child : traceEntryChildren) {
@Override
public void handle(List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState) {
for (TimeGraphEntry child : traceEntryChildren) {
}
List<ITimeEvent> eventList = getEventList(entry, ssq, fullStates, prevFullState, monitor);
if (eventList != null) {
}
List<ITimeEvent> eventList = getEventList(entry, ssq, fullStates, prevFullState, monitor);
if (eventList != null) {
- for (ITimeEvent event : eventList) {
- entry.addEvent(event);
+ /* Start a new event list on first iteration, then append to it */
+ if (prevFullState == null) {
+ entry.setEventList(eventList);
+ } else {
+ for (ITimeEvent event : eventList) {
+ entry.addEvent(event);
+ }
}
}
for (TimeGraphEntry child : entry.getChildren()) {
}
}
for (TimeGraphEntry child : entry.getChildren()) {
+ boolean isZoomThread = Thread.currentThread() instanceof ZoomThread;
eventList = new ArrayList<>(fullStates.size());
ITmfStateInterval lastInterval = prevFullState == null || statusQuark >= prevFullState.size() ? null : prevFullState.get(statusQuark);
long lastStartTime = lastInterval == null ? -1 : lastInterval.getStartTime();
eventList = new ArrayList<>(fullStates.size());
ITmfStateInterval lastInterval = prevFullState == null || statusQuark >= prevFullState.size() ? null : prevFullState.get(statusQuark);
long lastStartTime = lastInterval == null ? -1 : lastInterval.getStartTime();
eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
}
eventList.add(new TimeEvent(entry, time, duration, status));
eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
}
eventList.add(new TimeEvent(entry, time, duration, status));
+ } else if (isZoomThread) {
eventList.add(new NullTimeEvent(entry, time, duration));
}
lastStartTime = time;
eventList.add(new NullTimeEvent(entry, time, duration));
}
lastStartTime = time;
private static List<ITimeEvent> createIrqEventsList(ITimeGraphEntry entry, List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState, IProgressMonitor monitor, int quark) {
List<ITimeEvent> eventList;
private static List<ITimeEvent> createIrqEventsList(ITimeGraphEntry entry, List<List<ITmfStateInterval>> fullStates, List<ITmfStateInterval> prevFullState, IProgressMonitor monitor, int quark) {
List<ITimeEvent> eventList;
+ boolean isZoomThread = Thread.currentThread() instanceof ZoomThread;
eventList = new ArrayList<>(fullStates.size());
ITmfStateInterval lastInterval = prevFullState == null || quark >= prevFullState.size() ? null : prevFullState.get(quark);
long lastStartTime = lastInterval == null ? -1 : lastInterval.getStartTime();
eventList = new ArrayList<>(fullStates.size());
ITmfStateInterval lastInterval = prevFullState == null || quark >= prevFullState.size() ? null : prevFullState.get(quark);
long lastStartTime = lastInterval == null ? -1 : lastInterval.getStartTime();
*/
eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime, -1));
}
*/
eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime, -1));
}
- eventList.add(new NullTimeEvent(entry, time, duration));
+ if (isZoomThread) {
+ eventList.add(new NullTimeEvent(entry, time, duration));
+ }
lastIsNull = true;
}
lastStartTime = time;
lastIsNull = true;
}
lastStartTime = time;
if (monitor.isCanceled()) {
return;
}
if (monitor.isCanceled()) {
return;
}
- buildStatusEvents(parentTrace, (CallStackEntry) callStackEntry, monitor, start, end);
+ buildStatusEvents(parentTrace, (CallStackEntry) callStackEntry, monitor, ss.getStartTime(), end);
long resolution = Math.max(1, (end - ss.getStartTime()) / getDisplayWidth());
List<ITimeEvent> eventList = getEventList(entry, start, end + 1, resolution, monitor);
if (eventList != null) {
long resolution = Math.max(1, (end - ss.getStartTime()) / getDisplayWidth());
List<ITimeEvent> eventList = getEventList(entry, start, end + 1, resolution, monitor);
if (eventList != null) {
- for (ITimeEvent event : eventList) {
- entry.addEvent(event);
- }
+ entry.setEventList(eventList);
}
if (trace == getTrace()) {
redraw();
}
if (trace == getTrace()) {
redraw();
if (end <= start) {
return null;
}
if (end <= start) {
return null;
}
+ boolean isZoomThread = Thread.currentThread() instanceof ZoomThread;
List<ITimeEvent> eventList = null;
try {
List<ITmfStateInterval> stackIntervals = StateSystemUtils.queryHistoryRange(ss, entry.getQuark(), start, end - 1, resolution, monitor);
List<ITimeEvent> eventList = null;
try {
List<ITmfStateInterval> stackIntervals = StateSystemUtils.queryHistoryRange(ss, entry.getQuark(), start, end - 1, resolution, monitor);
eventList.add(new CallStackEvent(entry, time, duration, value));
lastIsNull = false;
} else {
eventList.add(new CallStackEvent(entry, time, duration, value));
lastIsNull = false;
} else {
- if (lastEndTime == -1) {
+ if (lastEndTime == -1 && isZoomThread) {
// add null event if it intersects the start time
eventList.add(new NullTimeEvent(entry, time, duration));
} else {
// add null event if it intersects the start time
eventList.add(new NullTimeEvent(entry, time, duration));
} else {
// add unknown event if between two null states
eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
}
// add unknown event if between two null states
eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
}
- if (time + duration >= endTime) {
+ if (time + duration >= endTime && isZoomThread) {
// add null event if it intersects the end time
eventList.add(new NullTimeEvent(entry, time, duration));
}
// add null event if it intersects the end time
eventList.add(new NullTimeEvent(entry, time, duration));
}