e4f685e225e355fb2710e07d0dd9722cd650a9ae
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ust.ui / src / org / eclipse / linuxtools / lttng2 / ust / ui / analysis / memory / UstMemoryAnalysisModule.java
1 /*******************************************************************************
2 * Copyright (c) 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 *******************************************************************************/
12
13 package org.eclipse.linuxtools.lttng2.ust.ui.analysis.memory;
14
15 import org.eclipse.linuxtools.internal.lttng2.ust.core.memoryusage.MemoryUsageStateProvider;
16 import org.eclipse.linuxtools.internal.lttng2.ust.ui.views.memusage.MemoryUsageView;
17 import org.eclipse.linuxtools.lttng2.ust.core.trace.LttngUstTrace;
18 import org.eclipse.linuxtools.tmf.core.exceptions.TmfAnalysisException;
19 import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider;
20 import org.eclipse.linuxtools.tmf.core.statesystem.TmfStateSystemAnalysisModule;
21 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
22 import org.eclipse.linuxtools.tmf.ui.analysis.TmfAnalysisViewOutput;
23
24 /**
25 * This analysis build a state system from the libc memory instrumentation on a
26 * ust trace
27 *
28 * @author Geneviève Bastien
29 * @since 3.0
30 */
31 public class UstMemoryAnalysisModule extends TmfStateSystemAnalysisModule {
32
33 /**
34 * Analysis ID, it should match that in the plugin.xml file
35 */
36 public static String ID = "org.eclipse.linuxtools.lttng2.ust.analysis.memory"; //$NON-NLS-1$
37
38 /**
39 * Constructor
40 */
41 public UstMemoryAnalysisModule() {
42 super();
43 registerOutput(new TmfAnalysisViewOutput(MemoryUsageView.ID));
44 }
45
46 @Override
47 protected
48 ITmfStateProvider createStateProvider() {
49 return new MemoryUsageStateProvider(getTrace());
50 }
51
52 @Override
53 protected StateSystemBackendType getBackendType() {
54 return StateSystemBackendType.FULL;
55 }
56
57 @Override
58 public void setTrace(ITmfTrace trace) throws TmfAnalysisException {
59 if (!(trace instanceof LttngUstTrace)) {
60 throw new IllegalStateException("UstMemoryAnalysisModule: trace should be of type LttngUstTrace"); //$NON-NLS-1$
61 }
62 super.setTrace(trace);
63 }
64
65 @Override
66 protected LttngUstTrace getTrace() {
67 return (LttngUstTrace) super.getTrace();
68 }
69
70 }
This page took 0.031949 seconds and 5 git commands to generate.