Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2018-05-03 11:07:51 -0400
committerGenevieve Bastien2018-05-03 14:29:28 -0400
commitbef295f92c13f11aaccb5f8d201e003cc663a1f9 (patch)
tree22cac5202f873338d655aec291885adcd8de9b8e
parent9df05bc25a5eebc672cc04681c9d9a5b27a97fcd (diff)
downloadorg.eclipse.tracecompass.incubator-bef295f92c13f11aaccb5f8d201e003cc663a1f9.tar.gz
org.eclipse.tracecompass.incubator-bef295f92c13f11aaccb5f8d201e003cc663a1f9.tar.xz
org.eclipse.tracecompass.incubator-bef295f92c13f11aaccb5f8d201e003cc663a1f9.zip
VM: Fix wrong condition in fused VM analysis
And add the test that would have avoided this error. Change-Id: I309a9c28bb6312f7119f8773a32705dd2552a23a Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/122120 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/OneQemuKvmFusedTestCase.java3
-rw-r--r--vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/QemuContainerTestCase.java3
-rw-r--r--vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/SimpleContainersTestCase.java2
-rw-r--r--vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/fused/handlers/FusedVirtualMachineStateProvider.java2
4 files changed, 9 insertions, 1 deletions
diff --git a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/OneQemuKvmFusedTestCase.java b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/OneQemuKvmFusedTestCase.java
index a4b7c95f..213b50ec 100644
--- a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/OneQemuKvmFusedTestCase.java
+++ b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/OneQemuKvmFusedTestCase.java
@@ -13,6 +13,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.fused.FusedAttributes;
+import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.virtual.resources.StateValues;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTestCase;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTestExperiment;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTraces;
@@ -85,10 +86,12 @@ public class OneQemuKvmFusedTestCase extends VmTestCase {
// Check the 'Machines' sub-tree towards the end of the trace
PunctualInfo oneInfo = new PunctualInfo(300L);
+ oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_ONE_QEMUKVM.getHostId()), StateValues.MACHINE_HOST);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_ONE_QEMUKVM.getHostId(), FusedAttributes.CPUS, "0"), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_ONE_QEMUKVM.getHostId(), FusedAttributes.PARENT), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_ONE_QEMUKVM.getHostId(), FusedAttributes.CONTAINERS), null);
+ oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_ONE_QEMUKVM.getHostId()), StateValues.MACHINE_GUEST);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_ONE_QEMUKVM.getHostId(), FusedAttributes.CPUS, "0"), 31);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_ONE_QEMUKVM.getHostId(), FusedAttributes.PARENT), VmTraces.HOST_ONE_QEMUKVM.getHostId());
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_ONE_QEMUKVM.getHostId(), FusedAttributes.PCPUS, "0"), null);
diff --git a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/QemuContainerTestCase.java b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/QemuContainerTestCase.java
index ca1bcb33..84e8d36c 100644
--- a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/QemuContainerTestCase.java
+++ b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/QemuContainerTestCase.java
@@ -14,6 +14,7 @@ import java.util.Set;
import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.fused.FusedAttributes;
import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.model.IVirtualMachineModel;
+import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.virtual.resources.StateValues;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTestCase;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTestExperiment;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTraces;
@@ -89,11 +90,13 @@ public class QemuContainerTestCase extends VmTestCase {
// Check the 'Machines' sub-tree towards the end of the trace
PunctualInfo oneInfo = new PunctualInfo(300L);
+ oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_QEMUKVM_CONTAINER.getHostId()), StateValues.MACHINE_HOST);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.CPUS, "0"), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.PARENT), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.CONTAINERS), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.HOST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.MACHINE_NAME), VmTraces.HOST_QEMUKVM_CONTAINER.getFileName());
+ oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_QEMUKVM_CONTAINER.getHostId()), StateValues.MACHINE_GUEST);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.CPUS, "0"), 31);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.PARENT), VmTraces.HOST_QEMUKVM_CONTAINER.getHostId());
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.GUEST_QEMUKVM_CONTAINER.getHostId(), FusedAttributes.PCPUS, "0"), null);
diff --git a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/SimpleContainersTestCase.java b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/SimpleContainersTestCase.java
index 74f4404e..72ca7b04 100644
--- a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/SimpleContainersTestCase.java
+++ b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests/src/org/eclipse/tracecompass/incubator/virtual/machine/analysis/core/tests/fused/SimpleContainersTestCase.java
@@ -13,6 +13,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.fused.FusedAttributes;
+import org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.virtual.resources.StateValues;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTestCase;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTestExperiment;
import org.eclipse.tracecompass.incubator.virtual.machine.analysis.core.tests.shared.vm.VmTraces;
@@ -77,6 +78,7 @@ public class SimpleContainersTestCase extends VmTestCase {
// Check the 'Machines' sub-tree towards the end of the trace
PunctualInfo oneInfo = new PunctualInfo(34L);
+ oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.ONE_CONTAINER.getHostId()), StateValues.MACHINE_HOST);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.ONE_CONTAINER.getHostId(), FusedAttributes.CPUS, "0"), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.ONE_CONTAINER.getHostId(), FusedAttributes.CPUS, "1"), null);
oneInfo.addValue(StateSystemTestUtils.makeAttribute(FusedAttributes.HOSTS, VmTraces.ONE_CONTAINER.getHostId(), FusedAttributes.PARENT), null);
diff --git a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/fused/handlers/FusedVirtualMachineStateProvider.java b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/fused/handlers/FusedVirtualMachineStateProvider.java
index 876888d8..36cdfb6f 100644
--- a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/fused/handlers/FusedVirtualMachineStateProvider.java
+++ b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/fused/handlers/FusedVirtualMachineStateProvider.java
@@ -512,7 +512,7 @@ public class FusedVirtualMachineStateProvider extends AbstractTmfStateProvider {
}
// Set the type
Object machineType = ss.queryOngoing(machineQuark);
- if (!(machineType instanceof Integer)) {
+ if (machineType instanceof Integer) {
continue;
}
ss.updateOngoingState(machine.getType(), machineQuark);

Back to the top