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