Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.3.0.qualifier
+Bundle-Version: 1.4.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.analysis.timing.ui;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.analysis.timing.ui.Activator
###############################################################################
-# Copyright (c) 2015 École Polytechnique de montréal
+# Copyright (c) 2015-2017 École Polytechnique de montréal
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
view.callgraphDensity= Function Durations Distribution
view.flameGraph= Flame Graph
view.segstore.table = Segment Store Table
+view.segstore.statistics = Descriptive Statistics
name="%view.segstore.table"
restorable="true">
</view>
+ <view
+ category="org.eclipse.linuxtools.tmf.ui.views.category"
+ class="org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.statistics.SegmentStoreStatisticsView"
+ icon="icons/eview16/statistics_view.gif"
+ id="org.eclipse.tracecompass.analysis.timing.ui.segstore.statistics"
+ name="%view.segstore.statistics"
+ restorable="true">
+ </view>
</extension>
</plugin>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.statistics;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.IViewDescriptor;
+
+/**
+ * Generic view for showing segment store statistics analysis data
+ *
+ * @since 1.4
+ */
+public class SegmentStoreStatisticsView extends AbstractSegmentsStatisticsView {
+
+ /**
+ * ID of this view
+ */
+ public static final String ID = "org.eclipse.tracecompass.analysis.timing.ui.segstore.statistics"; //$NON-NLS-1$
+
+ @Override
+ public void createPartControl(@Nullable Composite parent) {
+ super.createPartControl(parent);
+ // Set the title of the view from the actual view ID
+ IViewDescriptor desc = PlatformUI.getWorkbench().getViewRegistry().find(getViewId());
+ if (desc != null) {
+ setPartName(desc.getLabel());
+ }
+ }
+
+ @Override
+ protected @NonNull AbstractSegmentsStatisticsViewer createSegmentStoreStatisticsViewer(@NonNull Composite parent) {
+ // The analysis ID is the secondary ID of the view
+ String analysisId = NonNullUtils.nullToEmptyString(getViewSite().getSecondaryId());
+ return new SegmentStoreStatisticsViewer(parent, analysisId);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.statistics;
+
+import org.eclipse.jdt.annotation.NonNull;
+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.core.segmentstore.statistics.AbstractSegmentStatisticsAnalysis;
+import org.eclipse.tracecompass.segmentstore.core.ISegment;
+import org.eclipse.tracecompass.segmentstore.core.segment.interfaces.INamedSegment;
+import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * Generic viewer to show segment store statistics analysis data.
+ *
+ * @since 1.4
+ */
+public class SegmentStoreStatisticsViewer extends AbstractSegmentsStatisticsViewer {
+
+ private final String fAnalysisId;
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * The parent composite
+ * @param analysisId
+ * The ID of the segment store provider to do statistics on
+ */
+ public SegmentStoreStatisticsViewer(Composite parent, String analysisId) {
+ super(parent);
+ fAnalysisId = analysisId;
+ }
+
+ @Override
+ protected @Nullable TmfAbstractAnalysisModule createStatisticsAnalysiModule() {
+ AbstractSegmentStatisticsAnalysis module = new AbstractSegmentStatisticsAnalysis() {
+
+ @Override
+ protected @Nullable String getSegmentType(@NonNull ISegment segment) {
+ if (segment instanceof INamedSegment) {
+ return ((INamedSegment) segment).getName();
+ }
+ return null;
+ }
+
+ @Override
+ protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(@NonNull ITmfTrace trace) {
+ IAnalysisModule m = trace.getAnalysisModule(fAnalysisId);
+ if (!(m instanceof ISegmentStoreProvider)) {
+ return null;
+ }
+ return (ISegmentStoreProvider) m;
+ }
+
+ };
+ return module;
+ }
+
+}