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