gdbtrace: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core / src / org / eclipse / linuxtools / lttng2 / kernel / core / analysis / LttngKernelAnalysisModule.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 É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 * Contributors:
10 * Geneviève Bastien - Initial API and implementation
11 * Mathieu Rail - Provide the requirements of the analysis
12 *******************************************************************************/
13
14 package org.eclipse.linuxtools.lttng2.kernel.core.analysis;
15
16 import org.eclipse.jdt.annotation.NonNull;
17 import org.eclipse.linuxtools.internal.lttng2.kernel.core.LttngStrings;
18 import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.LttngKernelStateProvider;
19 import org.eclipse.linuxtools.lttng2.control.core.session.SessionConfigStrings;
20 import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement;
21 import org.eclipse.linuxtools.tmf.core.analysis.TmfAnalysisRequirement.ValuePriorityLevel;
22 import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider;
23 import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule;
24
25 import com.google.common.collect.ImmutableSet;
26
27 /**
28 * State System Module for lttng kernel traces
29 *
30 * @author Geneviève Bastien
31 * @since 3.0
32 */
33 public class LttngKernelAnalysisModule extends TmfStateSystemAnalysisModule {
34
35 /**
36 * The file name of the History Tree
37 */
38 public static final @NonNull String HISTORY_TREE_FILE_NAME = "stateHistory.ht"; //$NON-NLS-1$
39
40 /** The ID of this analysis module */
41 public static final @NonNull String ID = "org.eclipse.linuxtools.lttng2.kernel.analysis"; //$NON-NLS-1$
42
43 /*
44 * TODO: Decide which events should be mandatory for the analysis, once the
45 * appropriate error messages and session setup are in place.
46 */
47 private static final ImmutableSet<String> REQUIRED_EVENTS = ImmutableSet.of();
48
49 private static final ImmutableSet<String> OPTIONAL_EVENTS = ImmutableSet.of(
50 LttngStrings.EXIT_SYSCALL,
51 LttngStrings.IRQ_HANDLER_ENTRY,
52 LttngStrings.IRQ_HANDLER_EXIT,
53 LttngStrings.SOFTIRQ_ENTRY,
54 LttngStrings.SOFTIRQ_EXIT,
55 LttngStrings.SOFTIRQ_RAISE,
56 LttngStrings.SCHED_PROCESS_FORK,
57 LttngStrings.SCHED_PROCESS_EXIT,
58 LttngStrings.SCHED_PROCESS_FREE,
59 LttngStrings.SCHED_SWITCH,
60 LttngStrings.STATEDUMP_PROCESS_STATE,
61 LttngStrings.SCHED_WAKEUP,
62 LttngStrings.SCHED_WAKEUP_NEW,
63
64 /* FIXME Add the prefix for syscalls */
65 LttngStrings.SYSCALL_PREFIX
66 );
67
68 /** The requirements as an immutable set */
69 private static final ImmutableSet<TmfAnalysisRequirement> REQUIREMENTS;
70
71 static {
72 /* initialize the requirement: domain and events */
73 TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
74 domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, ValuePriorityLevel.MANDATORY);
75
76 TmfAnalysisRequirement eventReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, REQUIRED_EVENTS, ValuePriorityLevel.MANDATORY);
77 eventReq.addValues(OPTIONAL_EVENTS, ValuePriorityLevel.OPTIONAL);
78
79 REQUIREMENTS = ImmutableSet.of(domainReq, eventReq);
80 }
81
82 @Override
83 @NonNull
84 protected ITmfStateProvider createStateProvider() {
85 return new LttngKernelStateProvider(getTrace());
86 }
87
88 @Override
89 @NonNull
90 protected String getSsFileName() {
91 return HISTORY_TREE_FILE_NAME;
92 }
93
94 @Override
95 protected String getFullHelpText() {
96 return Messages.LttngKernelAnalysisModule_Help;
97 }
98
99 @Override
100 public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() {
101 return REQUIREMENTS;
102 }
103 }
This page took 0.049549 seconds and 5 git commands to generate.