1 /*******************************************************************************
2 * Copyright (c) 2013 É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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng2
.kernel
.ui
.analysis
;
15 import org
.eclipse
.jdt
.annotation
.NonNull
;
16 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.core
.stateprovider
.LttngKernelStateProvider
;
17 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.Messages
;
18 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.controlflow
.ControlFlowView
;
19 import org
.eclipse
.linuxtools
.internal
.lttng2
.kernel
.ui
.views
.resources
.ResourcesView
;
20 import org
.eclipse
.linuxtools
.lttng2
.kernel
.core
.trace
.LttngKernelTrace
;
21 import org
.eclipse
.linuxtools
.tmf
.core
.exceptions
.TmfAnalysisException
;
22 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.ITmfStateProvider
;
23 import org
.eclipse
.linuxtools
.tmf
.core
.statesystem
.TmfStateSystemAnalysisModule
;
24 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
25 import org
.eclipse
.linuxtools
.tmf
.ui
.analysis
.TmfAnalysisViewOutput
;
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$
45 * Constructor adding the views to the analysis
47 public LttngKernelAnalysisModule() {
49 this.registerOutput(new TmfAnalysisViewOutput(ControlFlowView
.ID
));
50 this.registerOutput(new TmfAnalysisViewOutput(ResourcesView
.ID
));
54 public void setTrace(ITmfTrace trace
) throws TmfAnalysisException
{
55 if (!(trace
instanceof LttngKernelTrace
)) {
56 throw new IllegalArgumentException("LttngKernelStateSystemModule: trace should be of type LttngKernelTrace"); //$NON-NLS-1$
58 super.setTrace(trace
);
62 protected LttngKernelTrace
getTrace() {
63 /* Cast should be safe because we check the type at the setTrace() */
64 return (LttngKernelTrace
) super.getTrace();
69 protected ITmfStateProvider
createStateProvider() {
70 return new LttngKernelStateProvider(getTrace());
75 protected StateSystemBackendType
getBackendType() {
76 return StateSystemBackendType
.FULL
;
81 protected String
getSsFileName() {
82 return HISTORY_TREE_FILE_NAME
;
86 protected String
getFullHelpText() {
87 return Messages
.LttngKernelAnalysis_Help
;