tmf/ust: deprecate AbstractCallStackAnalysis and move the UST module to core
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.ust.ui / src / org / eclipse / tracecompass / lttng2 / ust / ui / analysis / callstack / LttngUstCallStackAnalysis.java
1 /*******************************************************************************
2 * Copyright (c) 2014, 2016 Ericsson
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 * Alexandre Montplaisir - Initial API and implementation
11 * Bernd Hufmann - Added analysis requirements
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.lttng2.ust.ui.analysis.callstack;
15
16 import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
17
18 import java.util.Set;
19
20 import org.eclipse.jdt.annotation.NonNull;
21 import org.eclipse.jdt.annotation.Nullable;
22 import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysisRequirement;
23 import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackProvider;
24 import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
25 import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
26 import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
27 import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
28 import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
29 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
30 import org.eclipse.tracecompass.tmf.ui.views.callstack.AbstractCallStackAnalysis;
31
32 import com.google.common.collect.ImmutableSet;
33
34 /**
35 * Call-stack analysis to populate the TMF CallStack View from UST cyg-profile
36 * events.
37 *
38 * @author Alexandre Montplaisir
39 * @deprecated This analysis was moved to core as
40 * {@link org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysis}
41 * and is now internal
42 */
43 @Deprecated
44 public class LttngUstCallStackAnalysis extends AbstractCallStackAnalysis {
45
46 /**
47 * ID
48 *
49 * @since 2.0
50 */
51 public static final String ID = "org.eclipse.linuxtools.lttng2.ust.analysis.callstack"; //$NON-NLS-1$
52
53 private @Nullable Set<@NonNull TmfAbstractAnalysisRequirement> fAnalysisRequirements = null;
54
55 /**
56 * @since 1.0
57 */
58 @Override
59 public boolean setTrace(ITmfTrace trace) throws TmfAnalysisException {
60 if (!(trace instanceof LttngUstTrace)) {
61 return false;
62 }
63 return super.setTrace(trace);
64 }
65
66 @Override
67 protected LttngUstTrace getTrace() {
68 return (LttngUstTrace) super.getTrace();
69 }
70
71 @Override
72 protected ITmfStateProvider createStateProvider() {
73 return new LttngUstCallStackProvider(checkNotNull(getTrace()));
74 }
75
76 @Override
77 public @NonNull Iterable<@NonNull TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
78
79 Set<@NonNull TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements;
80 if (requirements == null) {
81 LttngUstTrace trace = getTrace();
82 ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT;
83 if (trace != null) {
84 layout = trace.getEventLayout();
85 }
86 requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout));
87 fAnalysisRequirements = requirements;
88 }
89 return requirements;
90 }
91
92 }
This page took 0.033466 seconds and 5 git commands to generate.