Skip to content

Commit

Permalink
flamechart: solve data provider resolve issue
Browse files Browse the repository at this point in the history
When opening a new view from a flamechart, the uuid is appended to the
secondary id, this makes the data provider not resolved correctly.

This commit will ignore the UUID of the trace to find the provider id.

Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
Change-Id: Ib7199bff3559199c626bdd8b9e5dc580623790c7
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/192597
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
arfio authored and MatthewKhouzam committed Nov 15, 2022
1 parent 90d2eac commit ea4a584
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -68,6 +68,7 @@
import org.eclipse.tracecompass.tmf.ui.editors.ITmfTraceEditor;
import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
import org.eclipse.tracecompass.tmf.ui.symbols.SymbolProviderConfigDialog;
import org.eclipse.tracecompass.tmf.ui.views.TmfViewFactory;
import org.eclipse.tracecompass.tmf.ui.views.timegraph.BaseDataProviderTimeGraphView;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphViewer;
Expand Down Expand Up @@ -368,13 +369,14 @@ protected void rebuild() {
@Override
protected String getProviderId() {
String secondaryId = this.getViewSite().getSecondaryId();
return (secondaryId == null) ? FlameChartDataProvider.ID : FlameChartDataProvider.ID + ':' + secondaryId;
return (secondaryId == null) ? FlameChartDataProvider.ID :
FlameChartDataProvider.ID + ':' + secondaryId.split(TmfViewFactory.INTERNAL_SECONDARY_ID_SEPARATOR)[0]; //NOSONAR
}

@Override
protected void buildEntryList(final ITmfTrace trace, final ITmfTrace parentTrace, final IProgressMonitor monitor) {
FlameChartDataProvider provider = DataProviderManager
.getInstance().getDataProvider(trace, getProviderId(), FlameChartDataProvider.class);
.getInstance().getOrCreateDataProvider(trace, getProviderId(), FlameChartDataProvider.class);
if (provider == null) {
addUnavailableEntry(trace, parentTrace);
return;
Expand Down

0 comments on commit ea4a584

Please sign in to comment.