Skip to content

Commit

Permalink
linux.core: Add Priority Statistics view for SWSLatency analysis
Browse files Browse the repository at this point in the history
This commit adds view and viewer classes for the Priority Statistics
view. It also adds the view to SWS Latency analysis. The view groups
entries in the SWS Latency analysis based on priority of the segments.

[Added] Priority Statistics view for SWSLatency analysis

Change-Id: If21c1fc53259fbef234d9155aabb5420d4bfbf98
Signed-off-by: Hoang Thuan Pham <hoang.pham@calian.ca>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/204775
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
hoangphamEclipse authored and PatrickTasse committed Oct 13, 2023
1 parent 1bbe313 commit 88f184d
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 1 deletion.
Expand Up @@ -64,7 +64,7 @@ Export-Package: org.eclipse.tracecompass.analysis.os.linux.core.contextswitch,
org.eclipse.tracecompass.lttng2.kernel.core.tests,
org.eclipse.tracecompass.analysis.callstack.core.tests",
org.eclipse.tracecompass.internal.analysis.os.linux.core.resourcesstatus;x-friends:="org.eclipse.tracecompass.analysis.os.linux.ui",
org.eclipse.tracecompass.internal.analysis.os.linux.core.segmentstore;x-internal:=true,
org.eclipse.tracecompass.internal.analysis.os.linux.core.segmentstore;x-friends:="org.eclipse.tracecompass.analysis.os.linux.ui",
org.eclipse.tracecompass.internal.analysis.os.linux.core.threadstatus;
x-friends:="org.eclipse.tracecompass.analysis.callstack.core,
org.eclipse.tracecompass.analysis.os.linux.core.tests,
Expand Down
Expand Up @@ -32,8 +32,10 @@ swslatency.table.view.name = Sched_Wakeup/Switch Latencies
swslatency.scatter.view.name = Sched_Wakeup/Switch Latency vs Time
swslatency.stats.view.name = Sched_Wakeup/Switch Latency Statistics
swslatency.stats.view.name.prioname = Sched_Wakeup/Switch Latency Priority/Thread name Statistics
swslatency.stats.view.name.priority = Sched_Wakeup/Switch Latency Priority Statistics
swslatency.density.view.name = Sched_Wakeup/Switch Density

view.segstore.statistics.prioname = Priority/Thread name Statistics
view.segstore.statistics.priority = Priority Statistics

perspective.name = OS Tracing Overview
24 changes: 24 additions & 0 deletions analysis/org.eclipse.tracecompass.analysis.os.linux.ui/plugin.xml
Expand Up @@ -46,6 +46,23 @@
name="%swslatency.stats.view.name.prioname"
restorable="true">
</view>
<view
category="org.eclipse.linuxtools.tmf.ui.views.category"
class="org.eclipse.tracecompass.analysis.os.linux.ui.segmentstore.statistics.PriorityStatisticsView"
icon="icons/eview16/statistics_view.gif"
id="org.eclipse.tracecompass.analysis.os.linux.ui.segmentstore.statistics.priority"
name="%view.segstore.statistics.priority"
restorable="true">
</view>
<view
allowMultiple="false"
category="org.eclipse.linuxtools.lttng2.ui.views.category"
class="org.eclipse.tracecompass.analysis.os.linux.ui.segmentstore.statistics.PriorityStatisticsView"
icon="icons/obj16/statistics_view.gif"
id="org.eclipse.tracecompass.analysis.os.linux.ui.segmentstore.statistics.priority:org.eclipse.tracecompass.analysis.os.linux.core.swslatency.sws"
name="%swslatency.stats.view.name.priority"
restorable="true">
</view>
<view
category="org.eclipse.linuxtools.lttng2.ui.views.category"
class="org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.swslatency.SWSLatencyDensityView"
Expand Down Expand Up @@ -225,6 +242,13 @@
class="org.eclipse.tracecompass.analysis.os.linux.core.swslatency.SWSLatencyAnalysis">
</analysisModuleClass>
</output>
<output
class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
id="org.eclipse.tracecompass.analysis.os.linux.ui.segmentstore.statistics.priority:org.eclipse.tracecompass.analysis.os.linux.core.swslatency.sws">
<analysisModuleClass
class="org.eclipse.tracecompass.analysis.os.linux.core.swslatency.SWSLatencyAnalysis">
</analysisModuleClass>
</output>
<output
class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
id="org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.swslatency.density">
Expand Down
@@ -0,0 +1,51 @@
/**********************************************************************
* Copyright (c) 2023 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.analysis.os.linux.ui.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.ui.views.segmentstore.statistics.AbstractSegmentsStatisticsView;
import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.statistics.AbstractSegmentsStatisticsViewer;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.IViewDescriptor;

/**
* A segment store statistics view for showing statistics based on the priority of segments
* The analysis specified by the secondaryId must create segments that implement IPrioritySegment.
*
* @author Hoang Thuan Pham
*/
public class PriorityStatisticsView extends AbstractSegmentsStatisticsView {
/**
* ID of this view
*/
public static final String ID = "org.eclipse.tracecompass.analysis.os.linux.ui.segmentstore.statistics.priority"; //$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 PriorityStatisticsViewer(parent, analysisId);
}
}
@@ -0,0 +1,36 @@
/**********************************************************************
* Copyright (c) 2023 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.analysis.os.linux.ui.segmentstore.statistics;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.statistics.AbstractSegmentsStatisticsViewer;
import org.eclipse.tracecompass.internal.analysis.os.linux.core.segmentstore.PriorityStatisticsDataProviderFactory;

/**
* A segment store statistics viewer for showing statistics based on the priority
* of segments.
*
* @author Hoang Thuan Pham
*/
public class PriorityStatisticsViewer extends AbstractSegmentsStatisticsViewer {
/**
* Constructor
*
* @param parent
* The parent composite
* @param analysisId
* The ID of the segment store provider to do statistics on
*/
public PriorityStatisticsViewer(Composite parent, String analysisId) {
super(parent, PriorityStatisticsDataProviderFactory.DATA_PROVIDER_ID + ':' + analysisId);
}
}

0 comments on commit 88f184d

Please sign in to comment.