<head>
<traceType id="org.eclipse.linuxtools.lttng2.kernel.tracetype" />
<label value="XML Futex Contention Analysis" />
+ <viewLabelPrefix value="Contention" />
</head>
<location id="CurrentCPU">
<head>
<traceType id="org.eclipse.linuxtools.lttng2.kernel.tracetype" />
<label value="XML IRQ Analysis"/>
+ <viewLabelPrefix value="IRQ" />
</head>
<storedField id="ret" alias="ret" />
private XmlPatternStateSystemModule fStateSystemModule;
private XmlPatternSegmentStoreModule fSegmentStoreModule;
private boolean fInitializationSucceeded;
+ private String fViewLabelPrefix;
/**
* Constructor
return fStateSystemModule.getStateSystems();
}
+ /**
+ * Set the associated view label prefix
+ *
+ * @param viewLabelPrefix
+ * The view label prefix
+ */
+ public void setViewLabelPrefix(String viewLabelPrefix) {
+ fViewLabelPrefix = viewLabelPrefix;
+ }
+
+ /**
+ * Get the associated view label prefix
+ *
+ * @return The view label prefix
+ */
+ public String getViewLabelPrefix() {
+ return fViewLabelPrefix;
+ }
+
@Override
public boolean waitForInitialization() {
try {
return name;
}
+ /**
+ * Get the XML view prefix label
+ *
+ * @return XML view prefix label or empty string if the value is missing in
+ * the XML element
+ */
+ public @NonNull String getViewLabelPrefix() {
+ if (!fType.equals(XmlAnalysisModuleType.PATTERN)) {
+ return TmfXmlStrings.EMPTY_STRING;
+ }
+ String viewLabel = TmfXmlStrings.EMPTY_STRING;
+ List<Element> head = TmfXmlUtils.getChildElements(fSourceElement, TmfXmlStrings.HEAD);
+ if (head.size() == 1) {
+ List<Element> labels = TmfXmlUtils.getChildElements(head.get(0), TmfXmlStrings.VIEW_LABEL_PREFIX);
+ if (!labels.isEmpty()) {
+ viewLabel = labels.get(0).getAttribute(TmfXmlStrings.VALUE);
+ }
+ }
+ return viewLabel;
+ }
+
@Override
public boolean isAutomatic() {
return false;
@Override
public String getHelpText() {
- return ""; //$NON-NLS-1$
+ return TmfXmlStrings.EMPTY_STRING;
}
@Override
public String getHelpText(@NonNull ITmfTrace trace) {
- return ""; //$NON-NLS-1$
+ return TmfXmlStrings.EMPTY_STRING;
}
@Override
module.setId(analysisid);
XmlPatternAnalysis paModule = (XmlPatternAnalysis) module;
paModule.setXmlFile(fSourceFile.toPath());
+ paModule.setViewLabelPrefix(getViewLabelPrefix());
break;
case OTHER:
String MAPPING_GROUP = "mappingGroup";
String ENTRY = "entry";
String INITIAL_STATE = "initialState";
+ String VIEW_LABEL_PREFIX = "viewLabelPrefix";
}
\ No newline at end of file
<xs:documentation>The text to name this pattern provider (and the analysis it will generate).</xs:documentation></xs:annotation></xs:attribute>
</xs:complexType>
</xs:element>
+ <xs:element maxOccurs="1" minOccurs="0" name="viewLabelPrefix">
+ <xs:annotation>
+ <xs:documentation>Adds a label prefix to the pattern latency views. If provided, this text will be used as prefix for the name of the latency views associated with this analysis</xs:documentation></xs:annotation>
+ <xs:complexType>
+ <xs:attribute name="value" >
+ <xs:annotation>
+ <xs:documentation>The text to use as prefix name this pattern latency views.</xs:documentation></xs:annotation></xs:attribute>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
</xs:complexType>
org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.latency;x-friends:="org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests",
org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.timegraph;x-friends:="org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests",
org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.xychart;x-internal:=true
-Import-Package: com.google.common.collect,
+Import-Package: com.google.common.base;version="15.0.0",
+ com.google.common.collect,
org.apache.commons.lang3,
org.eclipse.ui.views.properties
*/
public class TmfXmlAnalysisOutputSource implements ITmfNewAnalysisModuleListener {
+ private static final String LATENCY_STRING = "Latency"; //$NON-NLS-1$
/** String separating data elements for the output properties */
public static final @NonNull String DATA_SEPARATOR = ";;;"; //$NON-NLS-1$
// Add the latency views for pattern analysis
if (module instanceof XmlPatternAnalysis) {
for (LatencyViewType viewType : LatencyViewType.values()) {
- IAnalysisOutput output = new TmfXmlLatencyViewOutput(viewType.getViewId(), viewType.getLabel());
- output.setOutputProperty(TmfXmlUiStrings.XML_LATENCY_OUTPUT_DATA, module.getId() + DATA_SEPARATOR + viewType.getLabel(), false);
+ String viewLabelPrefix = ((XmlPatternAnalysis) module).getViewLabelPrefix();
+ String label = viewLabelPrefix.isEmpty() ? viewType.getLabel() : viewType.getLabel().replaceFirst(LATENCY_STRING, viewLabelPrefix);
+ IAnalysisOutput output = new TmfXmlLatencyViewOutput(viewType.getViewId(), label);
+ output.setOutputProperty(TmfXmlUiStrings.XML_LATENCY_OUTPUT_DATA, module.getId() + DATA_SEPARATOR + output.getName(), false);
module.registerOutput(output);
}
}
return fAnalysisId;
}
+ /**
+ * Get the view label
+ *
+ * @return The view label
+ */
+ public String getLabel() {
+ return fLabel;
+ }
+
/**
* Set the data for this view and retrieves from it the analysis ID of the
* pattern analysis this view belongs to and the view label.
if (newValue instanceof String) {
String data = (String) newValue;
fViewInfo.setViewData(data);
+ setPartName(fViewInfo.getLabel());
loadTableViewer();
loadDensityViewer();
}
if (newValue instanceof String) {
String data = (String) newValue;
fViewInfo.setViewData(data);
+ setPartName(fViewInfo.getLabel());
loadLatencyView();
}
}
if (newValue instanceof String) {
String data = (String) newValue;
fViewInfo.setViewData(data);
+ setPartName(fViewInfo.getLabel());
loadLatencyView();
}
}
if (newValue instanceof String) {
String data = (String) newValue;
fViewInfo.setViewData(data);
+ setPartName(fViewInfo.getLabel());
loadStatisticView();
}
}