/
FunctionDensityViewer.java
50 lines (45 loc) · 1.79 KB
/
FunctionDensityViewer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/******************************************************************************
* Copyright (c) 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tracecompass.internal.analysis.profiling.ui.functiondensity;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider;
import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.density2.AbstractSegmentStoreDensityViewer;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
/**
* Call stack segments density viewer
*
* @author Sonia Farrah
*/
public class FunctionDensityViewer extends AbstractSegmentStoreDensityViewer {
private final String fAnalysisId;
/**
* Constructs a new density viewer.
*
* @param parent
* the parent of the viewer
* @param analysisId
* The ID of the analysis for this view
*/
public FunctionDensityViewer(Composite parent, String analysisId) {
super(parent);
fAnalysisId = analysisId;
}
@Override
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace) {
IAnalysisModule modules = trace.getAnalysisModule(fAnalysisId);
if (!(modules instanceof ISegmentStoreProvider)) {
return null;
}
return (ISegmentStoreProvider) modules;
}
}