analysis: Introduce syscall statistics analysis test
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core.tests / src / org / eclipse / tracecompass / analysis / os / linux / core / tests / latency / SyscallAnalysisTest.java
index c8ad17d16e597c922c417908330f92a05b888f39..88859efeb09a46d0302761ae12266ebe3e2d688f 100644 (file)
@@ -12,25 +12,16 @@ package org.eclipse.tracecompass.analysis.os.linux.core.tests.latency;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.io.IOException;
-
-import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.analysis.os.linux.core.latency.SystemCallLatencyAnalysis;
-import org.eclipse.tracecompass.analysis.os.linux.core.tests.stubs.trace.KernelEventLayoutStub;
-import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
 import org.eclipse.tracecompass.segmentstore.core.ISegment;
 import org.eclipse.tracecompass.segmentstore.core.ISegmentStore;
 import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
-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;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
-import org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,35 +33,6 @@ import org.junit.Test;
  */
 public class SyscallAnalysisTest {
 
-    private static class KernelStubTrace extends CtfTmfTrace implements IKernelTrace {
-        public KernelStubTrace() {
-            super();
-        }
-
-        public static synchronized KernelStubTrace getTrace(CtfTestTrace ctfTrace) {
-            String tracePath;
-            try {
-                tracePath = FileLocator.toFileURL(ctfTrace.getTraceURL()).getPath();
-            } catch (IOException e) {
-                throw new IllegalStateException();
-            }
-
-            KernelStubTrace trace = new KernelStubTrace();
-            try {
-                trace.initTrace(null, tracePath, CtfTmfEvent.class);
-            } catch (TmfTraceException e) {
-                /* Should not happen if tracesExist() passed */
-                throw new RuntimeException(e);
-            }
-            return trace;
-        }
-
-        @Override
-        public @NonNull IKernelAnalysisEventLayout getKernelEventLayout() {
-            return KernelEventLayoutStub.getInstance();
-        }
-    }
-
     private SystemCallLatencyAnalysis fSyscallModule;
 
     /**
@@ -78,7 +40,7 @@ public class SyscallAnalysisTest {
      */
     @Before
     public void setUp() {
-        ITmfTrace trace = KernelStubTrace.getTrace(CtfTestTrace.ARM_64_BIT_HEADER);
+        ITmfTrace trace = KernelCtfTraceStub.getTrace(CtfTestTrace.ARM_64_BIT_HEADER);
         /* Make sure the Kernel analysis has run */
         ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
         for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(trace, SystemCallLatencyAnalysis.class)) {
This page took 0.024842 seconds and 5 git commands to generate.