os.linux: Move the HostThread class from lttng2.kernel to os.linux
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Mon, 19 Jan 2015 21:28:37 +0000 (16:28 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Fri, 6 Feb 2015 21:16:29 +0000 (16:16 -0500)
It is a class that can be used for other analyzes than only the virtual machine
one.

Change-Id: Icd417d68d41c6b6363fe440ab7cd38d9ab4ad9d2
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/39897
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
org.eclipse.tracecompass.analysis.os.linux.core/META-INF/MANIFEST.MF
org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/model/HostThread.java [new file with mode: 0644]
org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/model/package-info.java [new file with mode: 0644]
org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/HostThread.java [deleted file]
org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/IVirtualMachineModel.java
org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/qemukvm/QemuKvmVmModel.java
org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineStateProvider.java

index 35e02dffa955e75e1a7c8d18053b116f131b38ab..7a62e8bd3bffc9e73d364379bd6c24bdc2e16a56 100644 (file)
@@ -12,8 +12,10 @@ Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
  org.eclipse.tracecompass.common.core;bundle-version="0.1.0",
  org.eclipse.tracecompass.tmf.core;bundle-version="0.1.0"
-Import-Package: com.google.common.collect
+Import-Package: com.google.common.collect,
+ com.google.common.hash;version="15.0.0"
 Export-Package: org.eclipse.tracecompass.analysis.os.linux.core.cpuusage,
  org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis,
+ org.eclipse.tracecompass.analysis.os.linux.core.model,
  org.eclipse.tracecompass.analysis.os.linux.core.trace,
  org.eclipse.tracecompass.internal.analysis.os.linux.core;x-internal:=true
diff --git a/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/model/HostThread.java b/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/model/HostThread.java
new file mode 100644 (file)
index 0000000..e8a9a4f
--- /dev/null
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2014 É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
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Geneviève Bastien - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.model;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+
+import com.google.common.hash.HashFunction;
+import com.google.common.hash.Hashing;
+
+/**
+ * This class represents a thread from a specific host. Many machines in an
+ * experiment can have the same thread IDs. This class differentiates the
+ * threads by adding the host ID it belongs to.
+ *
+ * @author Geneviève Bastien
+ */
+public class HostThread {
+
+    private static final HashFunction HF = NonNullUtils.checkNotNull(Hashing.goodFastHash(32));
+
+    private final String fHost;
+    private final Integer fTid;
+
+    /**
+     * Constructor
+     *
+     * @param host
+     *            The host this thread belongs to
+     * @param tid
+     *            The thread ID of this thread
+     */
+    public HostThread(String host, Integer tid) {
+        fHost = host;
+        fTid = tid;
+    }
+
+    @Override
+    public int hashCode() {
+        return HF.newHasher()
+                .putUnencodedChars(fHost)
+                .putInt(fTid).hash().asInt();
+    }
+
+    @Override
+    public boolean equals(@Nullable Object o) {
+        if (o instanceof HostThread) {
+            HostThread hostTid = (HostThread) o;
+            if (fTid.equals(hostTid.fTid) &&
+                    fHost.equals(hostTid.fHost)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return "HostTid: [" + fHost + ',' + fTid + ']'; //$NON-NLS-1$
+    }
+
+    /**
+     * Get the thread ID of this thread
+     *
+     * @return The thread ID of this thread
+     */
+    public Integer getTid() {
+        return fTid;
+    }
+
+    /**
+     * Get the host ID of the machine this thread belongs to
+     *
+     * @return The host ID this thread belongs to
+     */
+    public String getHost() {
+        return fHost;
+    }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/model/package-info.java b/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/model/package-info.java
new file mode 100644 (file)
index 0000000..8fa2180
--- /dev/null
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2015 É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 accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    École Polytechnique de Montréal - Initial API and implementation
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.analysis.os.linux.core.model;
diff --git a/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/HostThread.java b/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/HostThread.java
deleted file mode 100644 (file)
index fe9c478..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 É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
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model;
-
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
-
-import com.google.common.hash.HashFunction;
-import com.google.common.hash.Hashing;
-
-/**
- * This class represents a thread from a specific host. Many machines in an
- * experiment can have the same thread IDs. This class differentiates the
- * threads by adding the host ID it belongs to.
- *
- * @author Geneviève Bastien
- */
-public class HostThread {
-
-    private static final HashFunction HF = NonNullUtils.checkNotNull(Hashing.goodFastHash(32));
-
-    private final String fHost;
-    private final Integer fTid;
-
-    /**
-     * Constructor
-     *
-     * @param host
-     *            The host this thread belongs to
-     * @param tid
-     *            The thread ID of this thread
-     */
-    public HostThread(String host, Integer tid) {
-        fHost = host;
-        fTid = tid;
-    }
-
-    @Override
-    public int hashCode() {
-        return HF.newHasher()
-                .putUnencodedChars(fHost)
-                .putInt(fTid).hash().asInt();
-    }
-
-    @Override
-    public boolean equals(@Nullable Object o) {
-        if (o instanceof HostThread) {
-            HostThread hostTid = (HostThread) o;
-            if (fTid.equals(hostTid.fTid) &&
-                    fHost.equals(hostTid.fHost)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return "HostTid: [" + fHost + ',' + fTid + ']'; //$NON-NLS-1$
-    }
-
-    /**
-     * Get the thread ID of this thread
-     *
-     * @return The thread ID of this thread
-     */
-    public Integer getTid() {
-        return fTid;
-    }
-
-    /**
-     * Get the host ID of the machine this thread belongs to
-     *
-     * @return The host ID this thread belongs to
-     */
-    public String getHost() {
-        return fHost;
-    }
-
-}
\ No newline at end of file
index 9b8f19a0e0ace4522287c0f5b11bfa59f9410fa9..4b226c5f3c94cc760003b0e047d32910bc6de615 100644 (file)
@@ -15,6 +15,7 @@ package org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 
 /**
index a03587c9978b0a2e96ded4e3b176c024a1a3e5c0..999d1d21544dfa48cece4dde00d45831dac0f764 100644 (file)
@@ -21,8 +21,8 @@ import java.util.Set;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
+import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
 import org.eclipse.tracecompass.common.core.NonNullUtils;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.HostThread;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.IVirtualMachineModel;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualCPU;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualMachine;
index 0192228c53eb7f44cb10eb8ad38ea8dde468c8a6..85e35f6357720ddfe66214c1401e71b75c3116b2 100644 (file)
@@ -20,12 +20,12 @@ import java.util.Map;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysis;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
+import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
 import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VcpuStateValues;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VmAttributes;
-import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.HostThread;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.IVirtualMachineModel;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualCPU;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualMachine;
This page took 0.028739 seconds and 5 git commands to generate.