tmf: Disable StateSystemAnalysisModuleTest#testIsQueryableCancel
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / analysis / os / linux / core / inputoutput / InputOutputAnalysisModule.java
1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
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
10 package org.eclipse.tracecompass.analysis.os.linux.core.inputoutput;
11
12 import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
13
14 import java.util.HashSet;
15 import java.util.Set;
16
17 import org.eclipse.tracecompass.analysis.os.linux.core.kernel.KernelAnalysisModule;
18 import org.eclipse.tracecompass.analysis.os.linux.core.trace.DefaultEventLayout;
19 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
20 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
21 import org.eclipse.tracecompass.internal.analysis.os.linux.core.inputoutput.InputOutputStateProvider;
22 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
23 import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
24 import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
25 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
26 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
27
28 /**
29 * State System Module for Input Output traces
30 *
31 * @author Houssem Daoud
32 * @since 2.0
33 */
34 public class InputOutputAnalysisModule extends TmfStateSystemAnalysisModule {
35
36 /** The ID of this analysis module */
37 public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.inputoutput"; //$NON-NLS-1$
38
39 @Override
40 protected ITmfStateProvider createStateProvider() {
41 ITmfTrace trace = checkNotNull(getTrace());
42 IKernelAnalysisEventLayout layout;
43
44 if (trace instanceof IKernelTrace) {
45 layout = ((IKernelTrace) trace).getKernelEventLayout();
46 } else {
47 /* Fall-back to the base LttngEventLayout */
48 layout = DefaultEventLayout.getInstance();
49 }
50
51 return new InputOutputStateProvider(trace, layout);
52 }
53
54 @Override
55 protected StateSystemBackendType getBackendType() {
56 return StateSystemBackendType.FULL;
57 }
58
59 @Override
60 protected Iterable<IAnalysisModule> getDependentAnalyses() {
61 Set<IAnalysisModule> modules = new HashSet<>();
62
63 ITmfTrace trace = getTrace();
64 if (trace == null) {
65 throw new IllegalStateException();
66 }
67 /*
68 * This analysis depends on the LTTng kernel analysis, so it's added to
69 * dependent modules.
70 */
71 Iterable<KernelAnalysisModule> kernelModules = TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class);
72 for (KernelAnalysisModule kernelModule : kernelModules) {
73 /* Only add the first one we find, if there is one */
74 modules.add(kernelModule);
75 break;
76 }
77 return modules;
78 }
79
80 }
This page took 0.032333 seconds and 5 git commands to generate.