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;
*/
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
// -------------------------------------------
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
// -------------------------------------------