os.tests: introduce test cases for the kernel analysis module
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Tue, 1 Mar 2016 20:22:01 +0000 (15:22 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Thu, 3 Mar 2016 03:46:35 +0000 (22:46 -0500)
It changes the current tests to use this notion of test case that will be used
to add unit tests for kernel analysis.

Change-Id: I1ccf0c68c48507a0948b29100058f0091e1a758b
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/67628
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/META-INF/MANIFEST.MF
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/kernelanalysis/KernelStateProviderTest.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/kernelanalysis/KernelThreadInformationProviderTest.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/kernelanalysis/KernelTidAspectTest.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/LinuxTestCase.java [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/kernel/KernelAnalysisTestFactory.java [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/kernel/package-info.java [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/package-info.java [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/testfiles/kernel_analysis/lttng_kernel_analysis.xml [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/testfiles/lttng_kernel_analysis.xml [deleted file]

index 7cd1290ccff114e354495ac96cc8538fa5447c4c..1372c27c12c808b8c1fecba8ae1b1baf8100bf03 100644 (file)
@@ -20,6 +20,7 @@ Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.tracecompass.analysis.timing.core;bundle-version="1.0.0",
  org.eclipse.tracecompass.statesystem.core.tests
 Import-Package: com.google.common.collect,
+ org.apache.commons.io;version="2.2.0",
  org.eclipse.tracecompass.testtraces.ctf;version="1.0.0"
 Export-Package: org.eclipse.tracecompass.analysis.os.linux.core.tests,
  org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage,
index d163f7efeba5c0fdfea2660e78ae33e17de06538..abce66bdb0a1a4b1b9e5fcc9511238ea433510ae 100644 (file)
 package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace.TmfXmlKernelTraceStub;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.LinuxTestCase;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.kernel.KernelAnalysisTestFactory;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
 import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.KernelStateProvider;
-import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
 import org.junit.After;
 import org.junit.Before;
@@ -36,7 +31,7 @@ import org.junit.Test;
  */
 public class KernelStateProviderTest {
 
-    private static final @NonNull String LTTNG_KERNEL_FILE = "testfiles/lttng_kernel_analysis.xml";
+    private static final @NonNull LinuxTestCase KERNEL_TEST_CASE = KernelAnalysisTestFactory.KERNEL_SCHED;
 
     private IKernelTrace fTrace;
     private ITmfStateProvider fInput;
@@ -46,18 +41,7 @@ public class KernelStateProviderTest {
      */
     @Before
     public void initialize() {
-        IKernelTrace thetrace = new TmfXmlKernelTraceStub();
-        IPath filePath = Activator.getAbsoluteFilePath(LTTNG_KERNEL_FILE);
-        IStatus status = thetrace.validate(null, filePath.toOSString());
-        if (!status.isOK()) {
-            fail(status.getException().getMessage());
-        }
-        try {
-            thetrace.initTrace(null, filePath.toOSString(), TmfEvent.class);
-        } catch (TmfTraceException e) {
-            fail(e.getMessage());
-        }
-
+        IKernelTrace thetrace = KERNEL_TEST_CASE.getKernelTrace();
         fTrace = thetrace;
         fInput = new KernelStateProvider(thetrace, thetrace.getKernelEventLayout());
     }
index 9e88a9880a038f5e2fb7df8aca3a1c2d0e1535af..024f4748c79c06852f4ae1c393167244ba602de8 100644 (file)
@@ -17,28 +17,23 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.util.Collection;
 import java.util.List;
 
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.StateValues;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace.TmfXmlKernelTraceStub;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.LinuxTestCase;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.kernel.KernelAnalysisTestFactory;
 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
 import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
-import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
@@ -57,7 +52,7 @@ import com.google.common.collect.ImmutableSet;
  */
 public class KernelThreadInformationProviderTest {
 
-    private static final @NonNull String LTTNG_KERNEL_FILE = "testfiles/lttng_kernel_analysis.xml";
+    private static final @NonNull LinuxTestCase KERNEL_TEST_CASE = KernelAnalysisTestFactory.KERNEL_SCHED;
 
     private ITmfTrace fTrace;
     private KernelAnalysisModule fModule;
@@ -75,17 +70,7 @@ public class KernelThreadInformationProviderTest {
      */
     @Before
     public void setUp() {
-        ITmfTrace trace = new TmfXmlKernelTraceStub();
-        IPath filePath = Activator.getAbsoluteFilePath(LTTNG_KERNEL_FILE);
-        IStatus status = trace.validate(null, filePath.toOSString());
-        if (!status.isOK()) {
-            fail(status.getException().getMessage());
-        }
-        try {
-            trace.initTrace(null, filePath.toOSString(), TmfEvent.class);
-        } catch (TmfTraceException e) {
-            fail(e.getMessage());
-        }
+        ITmfTrace trace = KERNEL_TEST_CASE.getKernelTrace();
         deleteSuppFiles(trace);
         ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
         IAnalysisModule module = null;
index a327617a1080e1a090c599590507bc3987e49444..613fc16ef91c61f5218440b1f994031e3d4434df 100644 (file)
@@ -12,21 +12,16 @@ package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
 
 import java.io.File;
 
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelTidAspect;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace.TmfXmlKernelTraceStub;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.LinuxTestCase;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.kernel.KernelAnalysisTestFactory;
 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
-import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
@@ -44,7 +39,7 @@ import org.junit.Test;
  */
 public class KernelTidAspectTest {
 
-    private static final @NonNull String LTTNG_KERNEL_FILE = "testfiles/lttng_kernel_analysis.xml";
+    private static final @NonNull LinuxTestCase KERNEL_TEST_CASE = KernelAnalysisTestFactory.KERNEL_SCHED;
 
     // ------------------------------------------------------------------------
     // Test trace class definition
@@ -65,17 +60,7 @@ public class KernelTidAspectTest {
      */
     @Before
     public void setUp() {
-        ITmfTrace trace = new TmfXmlKernelTraceStub();
-        IPath filePath = Activator.getAbsoluteFilePath(LTTNG_KERNEL_FILE);
-        IStatus status = trace.validate(null, filePath.toOSString());
-        if (!status.isOK()) {
-            fail(status.getException().getMessage());
-        }
-        try {
-            trace.initTrace(null, filePath.toOSString(), TmfEvent.class);
-        } catch (TmfTraceException e) {
-            fail(e.getMessage());
-        }
+        ITmfTrace trace = KERNEL_TEST_CASE.getKernelTrace();
         deleteSuppFiles(trace);
         /* Make sure the Kernel analysis has run */
         ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/LinuxTestCase.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/LinuxTestCase.java
new file mode 100644 (file)
index 0000000..c762c52
--- /dev/null
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2016 É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
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs;
+
+import static org.junit.Assert.fail;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.io.FilenameUtils;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.Activator;
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace.TmfXmlKernelTraceStub;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+
+/**
+ * Describe a test case for a linux unit test
+ *
+ * @author Geneviève Bastien
+ */
+public class LinuxTestCase {
+
+    private final String fTraceFile;
+
+    /**
+     * Class to group an attribute path and its intervals
+     */
+    public static class IntervalInfo {
+
+        private final String[] fAttributePath;
+        private final List<ITmfStateInterval> fIntervals;
+
+        IntervalInfo(List<ITmfStateInterval> intervals, String... attributePath) {
+            fAttributePath = attributePath;
+            fIntervals = intervals;
+        }
+
+        /**
+         * Get the attribute path
+         *
+         * @return The attribute path
+         */
+        public String[] getAttributePath() {
+            return fAttributePath;
+        }
+
+        /**
+         * Get the list of intervals
+         *
+         * @return The list of intervals
+         */
+        public List<ITmfStateInterval> getIntervals() {
+            return fIntervals;
+        }
+    }
+
+    /**
+     * Class to group a timestamp with a map of attributes and their expected
+     * values
+     */
+    public static class PunctualInfo {
+
+        private final long fTs;
+        private final Map<String[], ITmfStateValue> fValueMap;
+
+        /**
+         * Constructor
+         *
+         * @param ts
+         *            Timestamp of this test data
+         */
+        public PunctualInfo(long ts) {
+            fTs = ts;
+            fValueMap = new HashMap<>();
+        }
+
+        /**
+         * Get the timestamp this data is applied to
+         *
+         * @return The timestamp of this test data
+         */
+        public long getTimestamp() {
+            return fTs;
+        }
+
+        /**
+         * Get the test values
+         *
+         * @return The map of attribute path and values
+         */
+        public Map<String[], ITmfStateValue> getValues() {
+            return fValueMap;
+        }
+
+        /**
+         * Add an attribute value to verify
+         *
+         * @param key
+         *            The attribute path
+         * @param value
+         *            The value of this attribute at timestamp
+         */
+        public void addValue(String[] key, ITmfStateValue value) {
+            fValueMap.put(key, value);
+        }
+    }
+
+    /**
+     * Constructor
+     *
+     * @param filename
+     *            The filename of the trace file
+     */
+    public LinuxTestCase(String filename) {
+        fTraceFile = filename;
+    }
+
+    /**
+     * Get the last part of the file name containing the test trace
+     *
+     * @return The name of the file
+     */
+    public String getTraceFileName() {
+        return NonNullUtils.checkNotNull(FilenameUtils.getName(fTraceFile));
+    }
+
+    /**
+     * Initializes the trace for this test case. This method will always create
+     * a new trace. The caller must dispose of it the proper way.
+     *
+     * @return The {@link TmfXmlKernelTraceStub} created for this test case
+     */
+    public TmfXmlKernelTraceStub getKernelTrace() {
+        TmfXmlKernelTraceStub trace = new TmfXmlKernelTraceStub();
+        IPath filePath = Activator.getAbsoluteFilePath(fTraceFile);
+        IStatus status = trace.validate(null, filePath.toOSString());
+        if (!status.isOK()) {
+            fail(status.getException().getMessage());
+        }
+        try {
+            trace.initTrace(null, filePath.toOSString(), TmfEvent.class);
+        } catch (TmfTraceException e) {
+            fail(e.getMessage());
+        }
+        return trace;
+    }
+
+    /**
+     * This method will return a set of attributes and their corresponding
+     * expected intervals that will be tested with the actual intervals obtained
+     * from the state system. It does not have to return all attributes of a
+     * given state system, only the ones interesting for this test case.
+     *
+     * @return A set of {@link IntervalInfo} objects to verify
+     */
+    public Set<IntervalInfo> getTestIntervals() {
+        return Collections.EMPTY_SET;
+    }
+
+    /**
+     * This method will return a set of timestamps and their corresponding map
+     * of attributes and state values. The attribute list does not have to
+     * contain all attributes in the state system, only the ones that should be
+     * tested.
+     *
+     * @return A set of {@link PunctualInfo} objects to verify
+     */
+    public Set<PunctualInfo> getPunctualTestData() {
+        return Collections.EMPTY_SET;
+    }
+
+}
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/kernel/KernelAnalysisTestFactory.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/kernel/KernelAnalysisTestFactory.java
new file mode 100644 (file)
index 0000000..f549156
--- /dev/null
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2016 É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
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.kernel;
+
+import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.LinuxTestCase;
+
+/**
+ * Factory of tests for the kernel analysis module
+ *
+ * @author Geneviève Bastien
+ */
+public final class KernelAnalysisTestFactory {
+
+    private final static String TRACE_FILE_PATH = "testfiles/kernel_analysis/";
+
+    private KernelAnalysisTestFactory() {
+
+    }
+
+    /**
+     * This test case contains simple kernel trace events
+     */
+    public final static LinuxTestCase KERNEL_SCHED = new LinuxTestCase(TRACE_FILE_PATH + "lttng_kernel_analysis.xml") {
+
+    };
+}
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/kernel/package-info.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/kernel/package-info.java
new file mode 100644 (file)
index 0000000..05911c4
--- /dev/null
@@ -0,0 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2016 É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
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.kernel;
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/package-info.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/stubs/org/eclipse/tracecompass/analysis/os/linux/core/tests/stubs/package-info.java
new file mode 100644 (file)
index 0000000..f78457c
--- /dev/null
@@ -0,0 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2016 É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
+ *******************************************************************************/
+
+@org.eclipse.jdt.annotation.NonNullByDefault
+package org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs;
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/testfiles/kernel_analysis/lttng_kernel_analysis.xml b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/testfiles/kernel_analysis/lttng_kernel_analysis.xml
new file mode 100644 (file)
index 0000000..4e0469a
--- /dev/null
@@ -0,0 +1,151 @@
+<!-- ***************************************************************************
+* Simple LTTng Kernel trace, with simple process statedumps,
+* sched_switches and a process forking
+*************************************************************************** -->
+<trace>
+<set_aspects>
+<field name="cpu" value="1" type="int" />
+</set_aspects>
+<event timestamp="1" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="10" type="long" />
+<field name="vtid" value="10" type="long" />
+<field name="pid" value="10" type="long" />
+<field name="vpid" value="10" type="long" />
+<field name="ppid" value="0" type="long" />
+<field name="vppid" value="0" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc10" type="string" />
+</event>
+<event timestamp="5" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="11" type="long" />
+<field name="vtid" value="11" type="long" />
+<field name="pid" value="11" type="long" />
+<field name="vpid" value="11" type="long" />
+<field name="ppid" value="10" type="long" />
+<field name="vppid" value="10" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc11" type="string" />
+</event>
+<event timestamp="10" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="20" type="long" />
+<field name="vtid" value="20" type="long" />
+<field name="pid" value="20" type="long" />
+<field name="vpid" value="20" type="long" />
+<field name="ppid" value="0" type="long" />
+<field name="vppid" value="0" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc20" type="string" />
+</event>
+<event timestamp="12" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc3" type="string" />
+<field name="prev_tid" value="30" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc11" type="string" />
+<field name="next_tid" value="11" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+<event timestamp="15" name="lttng_statedump_process_state">
+<field name="cpu" value="0" type="int" />
+<field name="tid" value="30" type="long" />
+<field name="vtid" value="30" type="long" />
+<field name="pid" value="30" type="long" />
+<field name="vpid" value="30" type="long" />
+<field name="ppid" value="0" type="long" />
+<field name="vppid" value="0" type="long" />
+<field name="type" value="1" type="int" />
+<field name="mode" value="5" type="int" />
+<field name="submode" value="0" type="int" />
+<field name="status" value="5" type="long" />
+<field name="ns_level" value="0" type="int" />
+<field name="name" value="proc30" type="string" />
+</event>
+<event timestamp="17" name="lttng_statedump_end">
+<field name="cpu" value="0" type="int" />
+</event>
+<event timestamp="20" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc11" type="string" />
+<field name="prev_tid" value="10" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc20" type="string" />
+<field name="next_tid" value="20" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+<event timestamp="25" name="sched_process_fork">
+<field name="cpu" value="1" type="int" />
+<field name="parent_comm" value="proc20" type="string" />
+<field name="parent_tid" value="20" type="long" />
+<field name="parent_pid" value="20" type="int" />
+<field name="child_comm" value="proc20" type="string" />
+<field name="child_tid" value="21" type="long" />
+<field name="child_pid" value="20" type="int" />
+</event>
+<event timestamp="30" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc20" type="string" />
+<field name="prev_tid" value="20" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc21" type="string" />
+<field name="next_tid" value="21" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+<event timestamp="35" name="sched_switch">
+<field name="cpu" value="0" type="int" />
+<field name="prev_comm" value="lttng-sessiond" type="string" />
+<field name="prev_tid" value="100" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc11" type="string" />
+<field name="next_tid" value="11" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+<event timestamp="50" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc21" type="string" />
+<field name="prev_tid" value="21" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc30" type="string" />
+<field name="next_tid" value="30" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+<event timestamp="60" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc30" type="string" />
+<field name="prev_tid" value="30" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc21" type="string" />
+<field name="next_tid" value="21" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+<event timestamp="70" name="sched_switch">
+<field name="cpu" value="1" type="int" />
+<field name="prev_comm" value="proc21" type="string" />
+<field name="prev_tid" value="21" type="long" />
+<field name="prev_prio" value="20" type="long" />
+<field name="prev_state" value="0" type="long" />
+<field name="next_comm" value="proc20" type="string" />
+<field name="next_tid" value="20" type="long" />
+<field name="next_prio" value="20" type="long" />
+</event>
+</trace>
\ No newline at end of file
diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/testfiles/lttng_kernel_analysis.xml b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/testfiles/lttng_kernel_analysis.xml
deleted file mode 100644 (file)
index 4e0469a..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-<!-- ***************************************************************************
-* Simple LTTng Kernel trace, with simple process statedumps,
-* sched_switches and a process forking
-*************************************************************************** -->
-<trace>
-<set_aspects>
-<field name="cpu" value="1" type="int" />
-</set_aspects>
-<event timestamp="1" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="10" type="long" />
-<field name="vtid" value="10" type="long" />
-<field name="pid" value="10" type="long" />
-<field name="vpid" value="10" type="long" />
-<field name="ppid" value="0" type="long" />
-<field name="vppid" value="0" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc10" type="string" />
-</event>
-<event timestamp="5" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="11" type="long" />
-<field name="vtid" value="11" type="long" />
-<field name="pid" value="11" type="long" />
-<field name="vpid" value="11" type="long" />
-<field name="ppid" value="10" type="long" />
-<field name="vppid" value="10" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc11" type="string" />
-</event>
-<event timestamp="10" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="20" type="long" />
-<field name="vtid" value="20" type="long" />
-<field name="pid" value="20" type="long" />
-<field name="vpid" value="20" type="long" />
-<field name="ppid" value="0" type="long" />
-<field name="vppid" value="0" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc20" type="string" />
-</event>
-<event timestamp="12" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc3" type="string" />
-<field name="prev_tid" value="30" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc11" type="string" />
-<field name="next_tid" value="11" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-<event timestamp="15" name="lttng_statedump_process_state">
-<field name="cpu" value="0" type="int" />
-<field name="tid" value="30" type="long" />
-<field name="vtid" value="30" type="long" />
-<field name="pid" value="30" type="long" />
-<field name="vpid" value="30" type="long" />
-<field name="ppid" value="0" type="long" />
-<field name="vppid" value="0" type="long" />
-<field name="type" value="1" type="int" />
-<field name="mode" value="5" type="int" />
-<field name="submode" value="0" type="int" />
-<field name="status" value="5" type="long" />
-<field name="ns_level" value="0" type="int" />
-<field name="name" value="proc30" type="string" />
-</event>
-<event timestamp="17" name="lttng_statedump_end">
-<field name="cpu" value="0" type="int" />
-</event>
-<event timestamp="20" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc11" type="string" />
-<field name="prev_tid" value="10" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc20" type="string" />
-<field name="next_tid" value="20" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-<event timestamp="25" name="sched_process_fork">
-<field name="cpu" value="1" type="int" />
-<field name="parent_comm" value="proc20" type="string" />
-<field name="parent_tid" value="20" type="long" />
-<field name="parent_pid" value="20" type="int" />
-<field name="child_comm" value="proc20" type="string" />
-<field name="child_tid" value="21" type="long" />
-<field name="child_pid" value="20" type="int" />
-</event>
-<event timestamp="30" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc20" type="string" />
-<field name="prev_tid" value="20" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc21" type="string" />
-<field name="next_tid" value="21" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-<event timestamp="35" name="sched_switch">
-<field name="cpu" value="0" type="int" />
-<field name="prev_comm" value="lttng-sessiond" type="string" />
-<field name="prev_tid" value="100" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc11" type="string" />
-<field name="next_tid" value="11" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-<event timestamp="50" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc21" type="string" />
-<field name="prev_tid" value="21" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc30" type="string" />
-<field name="next_tid" value="30" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-<event timestamp="60" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc30" type="string" />
-<field name="prev_tid" value="30" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc21" type="string" />
-<field name="next_tid" value="21" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-<event timestamp="70" name="sched_switch">
-<field name="cpu" value="1" type="int" />
-<field name="prev_comm" value="proc21" type="string" />
-<field name="prev_tid" value="21" type="long" />
-<field name="prev_prio" value="20" type="long" />
-<field name="prev_state" value="0" type="long" />
-<field name="next_comm" value="proc20" type="string" />
-<field name="next_tid" value="20" type="long" />
-<field name="next_prio" value="20" type="long" />
-</event>
-</trace>
\ No newline at end of file
This page took 0.037826 seconds and 5 git commands to generate.