event = ctfContext.getCurrentEvent();
if (event != null) {
- updateAttributes(context, event.getTimestamp());
+ updateAttributes(context, event);
ctfContext.advance();
ctfContext.increaseRank();
}
*/
ITmfTimestamp timestamp = new TmfNanoTimestamp(event.getTimestamp().getValue() / SECONDS_TO_NS);
TmfEvent newEvent = new TmfEvent(this, ITmfContext.UNKNOWN_RANK, timestamp, eventType, eventFields);
- updateAttributes(savedContext, event.getTimestamp());
+ updateAttributes(savedContext, event);
context.increaseRank();
return newEvent;
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.tmf.core;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.tmf.core.Activator
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (C) 2011, Red Hat, Inc.
+ Copyright (C) 2011, 2015 Red Hat, Inc. and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
</parent>
<artifactId>org.eclipse.tracecompass.tmf.core</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Trace Compass TMF Core Plug-in</name>
final ITmfContext savedContext = new TmfContext(context.getLocation(), context.getRank());
final CustomTxtEvent event = parse(context);
if (event != null) {
- updateAttributes(savedContext, event.getTimestamp());
+ updateAttributes(savedContext, event);
context.increaseRank();
}
return event;
final ITmfContext savedContext = new TmfContext(context.getLocation(), context.getRank());
final CustomXmlEvent event = parse(context);
if (event != null) {
- updateAttributes(savedContext, event.getTimestamp());
+ updateAttributes(savedContext, event);
context.increaseRank();
}
return event;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisManager;
import org.eclipse.tracecompass.tmf.core.component.TmfEventProvider;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfLostEvent;
+import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
// parseEvent() does not update the context
final ITmfEvent event = parseEvent(context);
if (event != null) {
- ITmfTimestamp timestamp = event.getTimestamp();
- updateAttributes(context, timestamp);
+ updateAttributes(context, event);
context.setLocation(getCurrentLocation());
context.increaseRank();
}
*
* @param context the current trace context
* @param timestamp the corresponding timestamp
+ * @deprecated Use {@link #updateAttributes(ITmfContext, ITmfEvent)}
*/
+ @Deprecated
protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfTimestamp timestamp) {
+ updateAttributes(context, new TmfEvent(this, context.getRank(), timestamp, null, null));
+ }
+
+ /**
+ * Update the trace attributes
+ *
+ * @param context the current trace context
+ * @param event the corresponding event
+ * @since 1.1
+ */
+ protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfEvent event) {
+ ITmfTimestamp timestamp = event.getTimestamp();
+ ITmfTimestamp endTime = timestamp;
+ if (event instanceof ITmfLostEvent) {
+ endTime = ((ITmfLostEvent) event).getTimeRange().getEndTime();
+ }
if (fStartTime.equals(TmfTimestamp.BIG_BANG) || (fStartTime.compareTo(timestamp) > 0)) {
fStartTime = timestamp;
}
- if (fEndTime.equals(TmfTimestamp.BIG_CRUNCH) || (fEndTime.compareTo(timestamp) < 0)) {
- fEndTime = timestamp;
+ if (fEndTime.equals(TmfTimestamp.BIG_CRUNCH) || (fEndTime.compareTo(endTime) < 0)) {
+ fEndTime = endTime;
}
if (context.hasValidRank()) {
long rank = context.getRank();
/*******************************************************************************
- * Copyright (c) 2009, 2014 Ericsson, École Polytechnique de Montréal
+ * Copyright (c) 2009, 2015 Ericsson, École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
if (trace != TmfExperimentContext.NO_TRACE) {
event = expContext.getEvent(trace);
if (event != null) {
- updateAttributes(expContext, event.getTimestamp());
+ updateAttributes(expContext, event);
expContext.increaseRank();
expContext.setLastTrace(trace);
final ITmfContext traceContext = expContext.getContext(trace);
TextTraceContext savedContext = new TextTraceContext(context.getLocation(), context.getRank());
T event = parse((TextTraceContext) context);
if (event != null) {
- updateAttributes(savedContext, event.getTimestamp());
+ updateAttributes(savedContext, event);
context.increaseRank();
}
return event;