1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 École Polytechnique de Montréal
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
10 * Geneviève Bastien - Initial API and implementation
11 * Mathieu Rail - Provide the requirements of the analysis
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.analysis
;
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
;
25 import com
.google
.common
.collect
.ImmutableSet
;
28 * State System Module for lttng kernel traces
30 * @author Geneviève Bastien
33 public class LttngKernelAnalysisModule
extends TmfStateSystemAnalysisModule
{
36 * The file name of the History Tree
39 public static final String HISTORY_TREE_FILE_NAME
= "stateHistory.ht"; //$NON-NLS-1$
41 /** The ID of this analysis module */
42 public static final String ID
= "org.eclipse.linuxtools.lttng2.kernel.analysis"; //$NON-NLS-1$
44 /* TODO: Are all those mandatory events really mandatory or should some of them be optional? */
45 private static final ImmutableSet
<String
> REQUIRED_EVENTS
= ImmutableSet
.of(
46 LttngStrings
.EXIT_SYSCALL
,
47 LttngStrings
.IRQ_HANDLER_ENTRY
,
48 LttngStrings
.IRQ_HANDLER_EXIT
,
49 LttngStrings
.SOFTIRQ_ENTRY
,
50 LttngStrings
.SOFTIRQ_EXIT
,
51 LttngStrings
.SOFTIRQ_RAISE
,
52 LttngStrings
.SCHED_SWITCH
,
53 LttngStrings
.SCHED_PROCESS_FORK
,
54 LttngStrings
.SCHED_PROCESS_EXIT
,
55 LttngStrings
.SCHED_PROCESS_FREE
,
56 LttngStrings
.STATEDUMP_PROCESS_STATE
,
57 LttngStrings
.SCHED_WAKEUP
,
58 LttngStrings
.SCHED_WAKEUP_NEW
61 private static final ImmutableSet
<String
> OPTIONAL_EVENTS
= ImmutableSet
.of(
62 /* Add the prefix for syscalls */
63 LttngStrings
.SYSCALL_PREFIX
67 /** The requirements as an immutable set */
68 private static final ImmutableSet
<TmfAnalysisRequirement
> REQUIREMENTS
;
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
);
75 TmfAnalysisRequirement eventReq
= new TmfAnalysisRequirement(SessionConfigStrings
.CONFIG_ELEMENT_EVENT
, REQUIRED_EVENTS
, ValuePriorityLevel
.MANDATORY
);
76 eventReq
.addValues(OPTIONAL_EVENTS
, ValuePriorityLevel
.OPTIONAL
);
78 REQUIREMENTS
= ImmutableSet
.of(domainReq
, eventReq
);
83 protected ITmfStateProvider
createStateProvider() {
84 return new LttngKernelStateProvider(getTrace());
89 protected String
getSsFileName() {
90 return HISTORY_TREE_FILE_NAME
;
94 protected String
getFullHelpText() {
95 return Messages
.LttngKernelAnalysisModule_Help
;
99 public Iterable
<TmfAnalysisRequirement
> getAnalysisRequirements() {