From a0a4901e1d75268659a00666b9eeefe3eb0b14b5 Mon Sep 17 00:00:00 2001 From: Francois Chouinard Date: Fri, 11 May 2012 14:27:13 -0400 Subject: [PATCH] Fix experiment checkpoint issue with CTF traces --- .../linuxtools/tmf/core/experiment/TmfExperiment.java | 4 ++-- .../eclipse/linuxtools/tmf/core/trace/ITmfContext.java | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java index 4f2f069291..afc5c2ce79 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java @@ -275,10 +275,10 @@ public class TmfExperiment extends TmfTrace implements I */ @Override public synchronized ITmfEvent readNextEvent(final ITmfContext context) { - // parseEvent() does not update the context + final ITmfContext previousContext = (TmfExperimentContext) context.clone(); final ITmfEvent event = parseEvent(context); if (event != null) { - updateAttributes(context, event.getTimestamp()); + updateAttributes(previousContext, event.getTimestamp()); TmfExperimentContext expContext = (TmfExperimentContext) context; int trace = expContext.getLastTrace(); diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java index a65e020ad2..cfee4087b5 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java @@ -15,10 +15,11 @@ package org.eclipse.linuxtools.tmf.core.trace; /** * The basic trace context structure in TMF. The purpose of the context is to - * associate a trace location to an event of a specific rank (order). + * associate a trace location to an event at a specific rank (order). *

* The context should be sufficient to allow the trace to position itself so - * that performing a trace read operation will yield the corresponding event. + * that performing a trace read operation will yield the corresponding 'nth' + * event. * * @version 1.0 * @author Francois Chouinard @@ -41,12 +42,12 @@ public interface ITmfContext { // ------------------------------------------------------------------------ /** - * @return the rank of the event referred to by the context + * @return the rank of the event at the context location */ public long getRank(); /** - * @return the location of the event referred to by the context + * @return the location of the event at the context rank */ public ITmfLocation> getLocation(); -- 2.34.1