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;
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) {
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);
// 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
// ========================================================================
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++;
}
}
+ /**
+ * @return
+ */
+ public int getEventsDiscardedNotVisible() {
+ return eventsDiscardedNotVisible;
+
+ }
+
+ /**
+ * @return
+ */
+ public int getEventsDiscardedOutOfViewRange() {
+ return eventsDiscardedOutOfView;
+
+ }
+
/**
* @return
*/
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();
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;
}
&& ((double) eventSpan * k) < 2) {
// discard the item
- params.incrementEventsDiscarded();
+ params.incrementEventsDiscarded(ParamsUpdater.NOT_VISIBLE);
return false;
}
// Check if the event is out of range
if (!withinViewRange(stime, etime)) {
- params.incrementEventsDiscarded();
+ params.incrementEventsDiscarded(ParamsUpdater.OUT_OF_VIEWRANGE);
return false;
}
Long eventSpan = stime - prevEvent.getStartTime();
if (prevEventVisibility == false
&& ((double) eventSpan * k) < 2) {
- params.incrementEventsDiscarded();
+ params.incrementEventsDiscarded(ParamsUpdater.NOT_VISIBLE);
return false;
}
}
// 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<Long>(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<Long> location = (TmfLocation<Long>) 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<Long>(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<Long> location = (TmfLocation<Long>) 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;