From: Alvaro Sanchez-Leon Date: Fri, 4 Jun 2010 21:15:54 +0000 (+0000) Subject: June 4, 2010 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=5dbe4d3bedf5377a9d54e1c69e838733deb9e325;p=deliverable%2Ftracecompass.git June 4, 2010 Fixed - bug 315828: [LTTng] Control flow view states not initialised properly https://bugs.eclipse.org/bugs/show_bug.cgi?id=315828 --- diff --git a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/AbsTimeUpdateView.java b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/AbsTimeUpdateView.java index 85d1102673..cdd3659f47 100644 --- a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/AbsTimeUpdateView.java +++ b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/AbsTimeUpdateView.java @@ -26,7 +26,6 @@ import org.eclipse.linuxtools.lttng.request.RequestStartedSignal; import org.eclipse.linuxtools.lttng.state.evProcessor.ITransEventProcessor; import org.eclipse.linuxtools.lttng.ui.TraceDebug; import org.eclipse.linuxtools.lttng.ui.model.trange.ItemContainer; -import org.eclipse.linuxtools.lttng.ui.views.resources.model.ResourceModelFactory; import org.eclipse.linuxtools.tmf.event.TmfEvent; import org.eclipse.linuxtools.tmf.event.TmfTimeRange; import org.eclipse.linuxtools.tmf.event.TmfTimestamp; @@ -570,7 +569,7 @@ public abstract class AbsTimeUpdateView extends TmfView implements if (complete) { // reselect to original time - ParamsUpdater paramUpdater = ResourceModelFactory.getParamsUpdater(); + ParamsUpdater paramUpdater = getParamsUpdater(); if (paramUpdater != null && tsfviewer != null) { final Long selTime = paramUpdater.getSelectedTime(); if (selTime != null) { @@ -590,13 +589,17 @@ public abstract class AbsTimeUpdateView extends TmfView implements eventCount += itemArr[pos].getTraceEvents().size(); } - int discarded = getParamsUpdater().getEventsDiscarded(); + int discarded = paramUpdater.getEventsDiscarded(); int discardedOutofOrder = paramUpdater.getEventsDiscardedWrongOrder(); + int discardedOutofViewRange = paramUpdater.getEventsDiscardedOutOfViewRange(); + int dicardedNotVisible = paramUpdater.getEventsDiscardedNotVisible(); + TmfTimeRange range = request.getRange(); StringBuilder sb = new StringBuilder("View: " + getName() + ", Events handled: " + count + ", Events loaded in view: " + eventCount + ", Number of events discarded: " + discarded + "\n\tNumber of events discarded with start time earlier than next good time: " - + discardedOutofOrder); + + discardedOutofOrder + "\n\tDiscarded Not visible: " + dicardedNotVisible + + "\n\tDiscarded out of view Range: " + discardedOutofViewRange); sb.append("\n\t\tRequested Time Range: " + range.getStartTime() + "-" + range.getEndTime()); sb.append("\n\t\tExperiment Time Range: " + experimentStartTime + "-" + experimentEndTime); diff --git a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/ParamsUpdater.java b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/ParamsUpdater.java index ae9c3a5bb3..0126177a40 100644 --- a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/ParamsUpdater.java +++ b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/ParamsUpdater.java @@ -40,9 +40,14 @@ public class ParamsUpdater { // time interval private double pixelsPerNs = 0; private int eventsDiscarded = 0; + private int eventsDiscardedOutOfView = 0; + private int eventsDiscardedNotVisible = 0; private int eventsDiscardedWrongOrder = 0; private TmfTimeRange trange = null; + public static final int OUT_OF_VIEWRANGE = 0; + public static final int NOT_VISIBLE = 1; + // ======================================================================== // Methods // ======================================================================== @@ -218,13 +223,23 @@ public class ParamsUpdater { eventsDiscarded = value; if (value == 0) { eventsDiscardedWrongOrder = 0; + eventsDiscardedNotVisible = 0; + eventsDiscardedOutOfView = 0; } } /** * */ - public void incrementEventsDiscarded() { + public void incrementEventsDiscarded(int reason) { + if (reason == OUT_OF_VIEWRANGE) { + this.eventsDiscardedOutOfView++; + } + + if (reason == NOT_VISIBLE) { + this.eventsDiscardedNotVisible++; + } + this.eventsDiscarded++; } @@ -252,6 +267,22 @@ public class ParamsUpdater { } + /** + * @return + */ + public int getEventsDiscardedNotVisible() { + return eventsDiscardedNotVisible; + + } + + /** + * @return + */ + public int getEventsDiscardedOutOfViewRange() { + return eventsDiscardedOutOfView; + + } + /** * @return */ diff --git a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/evProcessor/AbsFlowTRangeUpdate.java b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/evProcessor/AbsFlowTRangeUpdate.java index 0417d05850..c0a9ccc599 100644 --- a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/evProcessor/AbsFlowTRangeUpdate.java +++ b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/controlflow/evProcessor/AbsFlowTRangeUpdate.java @@ -109,6 +109,10 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt Long stime = startTime; Long etime = endTime; +// if (etime == 13589873239052L || etime == 13589878374675L) { +// System.out.println("probe here, " + stime + "->" + etime); +// } + if (etime < stime) { // Validate the sequential order of events params.incrementEventsDiscardedWrongOrder(); @@ -124,7 +128,7 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt if (!withinViewRange(stime, etime)) { // No use to process the event since it's outside // the visible time range of the window - params.incrementEventsDiscarded(); + params.incrementEventsDiscarded(ParamsUpdater.OUT_OF_VIEWRANGE); return false; } @@ -159,7 +163,7 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt && ((double) eventSpan * k) < 2) { // discard the item - params.incrementEventsDiscarded(); + params.incrementEventsDiscarded(ParamsUpdater.NOT_VISIBLE); return false; } diff --git a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/resources/evProcessor/AbsResourcesTRangeUpdate.java b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/resources/evProcessor/AbsResourcesTRangeUpdate.java index fa92ab1dbb..8b9b511b68 100644 --- a/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/resources/evProcessor/AbsResourcesTRangeUpdate.java +++ b/org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/resources/evProcessor/AbsResourcesTRangeUpdate.java @@ -197,7 +197,7 @@ public abstract class AbsResourcesTRangeUpdate extends AbsTRangeUpdate // Check if the event is out of range if (!withinViewRange(stime, etime)) { - params.incrementEventsDiscarded(); + params.incrementEventsDiscarded(ParamsUpdater.OUT_OF_VIEWRANGE); return false; } @@ -243,7 +243,7 @@ public abstract class AbsResourcesTRangeUpdate extends AbsTRangeUpdate Long eventSpan = stime - prevEvent.getStartTime(); if (prevEventVisibility == false && ((double) eventSpan * k) < 2) { - params.incrementEventsDiscarded(); + params.incrementEventsDiscarded(ParamsUpdater.NOT_VISIBLE); return false; } } diff --git a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/trace/StateTraceManager.java b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/trace/StateTraceManager.java index c41c48a3b9..7e533bfc9c 100644 --- a/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/trace/StateTraceManager.java +++ b/org.eclipse.linuxtools.lttng/src/org/eclipse/linuxtools/lttng/state/trace/StateTraceManager.java @@ -204,38 +204,38 @@ public class StateTraceManager extends LTTngTreeNode implements IStateTraceManag // can handle multiple traces if ((eventTime.getValue() < fTrace.getStartTime().getValue())) { eventTime = fTrace.getStartTime(); + } - Collections.sort(timestampCheckpointsList); - // Initiate the compare with a checkpoint containing the target time - // stamp to find - int index = Collections.binarySearch(timestampCheckpointsList, new TmfCheckpoint(eventTime, - new TmfLocation(0L))); - // adjust index to round down to earlier checkpoint when exact match - // not - // found - index = getPrevIndex(index); - - LttngTraceState traceState; - if (index == 0) { - // No checkpoint restore is needed, start with a brand new - // TraceState - traceState = StateModelFactory.getStateEntryInstance(this); - } else { - synchronized (checkPointsLock) { - // Useful CheckPoint found - TmfCheckpoint checkpoint = timestampCheckpointsList.get(index); - nearestTimeStamp = checkpoint.getTimestamp(); - // get the location associated with the checkpoint - TmfLocation location = (TmfLocation) checkpoint.getLocation(); - // reference a new copy of the checkpoint template - traceState = stateCheckpointsList.get(location.getLocation()).clone(); - } + Collections.sort(timestampCheckpointsList); + // Initiate the compare with a checkpoint containing the target time + // stamp to find + int index = Collections.binarySearch(timestampCheckpointsList, new TmfCheckpoint(eventTime, + new TmfLocation(0L))); + // adjust index to round down to earlier checkpoint when exact match + // not + // found + index = getPrevIndex(index); + + LttngTraceState traceState; + if (index == 0) { + // No checkpoint restore is needed, start with a brand new + // TraceState + traceState = StateModelFactory.getStateEntryInstance(this); + } else { + synchronized (checkPointsLock) { + // Useful CheckPoint found + TmfCheckpoint checkpoint = timestampCheckpointsList.get(index); + nearestTimeStamp = checkpoint.getTimestamp(); + // get the location associated with the checkpoint + TmfLocation location = (TmfLocation) checkpoint.getLocation(); + // reference a new copy of the checkpoint template + traceState = stateCheckpointsList.get(location.getLocation()).clone(); } + } - // Restore the stored traceState - synchronized (this) { - fStateModel = traceState; - } + // Restore the stored traceState + synchronized (this) { + fStateModel = traceState; } return nearestTimeStamp;