linux.core: fix break in build.
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core.tests / src / org / eclipse / tracecompass / analysis / os / linux / core / tests / latency / SyscallAnalysisTest.java
CommitLineData
913e4cd0
MK
1/*******************************************************************************
2 * Copyright (c) 2016 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10package org.eclipse.tracecompass.analysis.os.linux.core.tests.latency;
11
12import static org.junit.Assert.assertEquals;
13import static org.junit.Assert.assertNotNull;
14
913e4cd0 15import org.eclipse.jdt.annotation.NonNull;
97a06f36 16import org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.SystemCallLatencyAnalysis;
913e4cd0
MK
17import org.eclipse.tracecompass.segmentstore.core.ISegment;
18import org.eclipse.tracecompass.segmentstore.core.ISegmentStore;
19import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
20import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
913e4cd0
MK
21import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
22import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
23import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
24import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
913e4cd0
MK
25import org.junit.After;
26import org.junit.Before;
27import org.junit.Test;
28
29/**
30 * Tests for the system call analysis
31 *
32 * @author Matthew Khouzam
33 */
34public class SyscallAnalysisTest {
35
913e4cd0
MK
36 private SystemCallLatencyAnalysis fSyscallModule;
37
38 /**
39 * Test setup
40 */
41 @Before
42 public void setUp() {
3a676d86 43 ITmfTrace trace = KernelCtfTraceStub.getTrace(CtfTestTrace.ARM_64_BIT_HEADER);
913e4cd0
MK
44 /* Make sure the Kernel analysis has run */
45 ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null));
46 for (IAnalysisModule mod : TmfTraceUtils.getAnalysisModulesOfClass(trace, SystemCallLatencyAnalysis.class)) {
47 fSyscallModule = (SystemCallLatencyAnalysis) mod;
48 }
49 assertNotNull(fSyscallModule);
50 fSyscallModule.schedule();
51 fSyscallModule.waitForCompletion();
52 }
53
54 /**
55 * Dispose everything
56 */
57 @After
58 public void cleanup() {
59 final SystemCallLatencyAnalysis syscallModule = fSyscallModule;
60 if( syscallModule != null) {
61 syscallModule.dispose();
62 }
63 }
64
65 /**
66 * This will load the analysis and test it. as it depends on Kernel, this
67 * test runs the kernel trace first then the analysis
68 */
69 @Test
70 public void testSmallTraceSequential() {
71 final SystemCallLatencyAnalysis syscallModule = fSyscallModule;
72 assertNotNull(syscallModule);
73 ISegmentStore<@NonNull ISegment> segmentStore = syscallModule.getSegmentStore();
74 assertNotNull(segmentStore);
75 assertEquals(1801, segmentStore.size());
76 }
77}
This page took 0.028817 seconds and 5 git commands to generate.