Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java')
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
index 5bdbfbbc7c..4c9d9dd0b5 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
@@ -21,6 +21,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
+import org.eclipse.linuxtools.ctf.core.event.CTFClock;
import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
@@ -52,6 +53,11 @@ public class CtfTmfTrace extends TmfTrace
*/
protected static final int DEFAULT_CACHE_SIZE = 50000;
+ /*
+ * The Ctf clock unique identifier field
+ */
+ private static final String CLOCK_HOST_PROPERTY = "uuid"; //$NON-NLS-1$
+
// -------------------------------------------
// Fields
// -------------------------------------------
@@ -280,6 +286,25 @@ public class CtfTmfTrace extends TmfTrace
return fTrace;
}
+ /**
+ * Ctf traces have a clock with a unique uuid that will be used to identify
+ * the host. Traces with the same clock uuid will be known to have been made
+ * on the same machine.
+ *
+ * Note: uuid is an optional field, it may not be there for a clock.
+ */
+ @Override
+ public String getHostId() {
+ CTFClock clock = getCTFTrace().getClock();
+ if (clock != null) {
+ String clockHost = (String) clock.getProperty(CLOCK_HOST_PROPERTY);
+ if (clockHost != null) {
+ return clockHost;
+ }
+ }
+ return super.getHostId();
+ }
+
// -------------------------------------------
// ITmfTraceProperties
// -------------------------------------------

Back to the top