From ea4a5841f27773221d42041600d0e333aa7ce28d Mon Sep 17 00:00:00 2001 From: Arnaud Fiorini Date: Fri, 8 Apr 2022 15:48:11 -0400 Subject: [PATCH] flamechart: solve data provider resolve issue 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 Change-Id: Ib7199bff3559199c626bdd8b9e5dc580623790c7 Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/192597 Tested-by: Trace Compass Bot Tested-by: Bernd Hufmann Tested-by: Matthew Khouzam Reviewed-by: Bernd Hufmann Reviewed-by: Matthew Khouzam --- .../callstack/ui/views/flamechart/FlameChartView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.ui/src/org/eclipse/tracecompass/incubator/internal/callstack/ui/views/flamechart/FlameChartView.java b/callstack/org.eclipse.tracecompass.incubator.callstack.ui/src/org/eclipse/tracecompass/incubator/internal/callstack/ui/views/flamechart/FlameChartView.java index d7abbfe8..d0586155 100644 --- a/callstack/org.eclipse.tracecompass.incubator.callstack.ui/src/org/eclipse/tracecompass/incubator/internal/callstack/ui/views/flamechart/FlameChartView.java +++ b/callstack/org.eclipse.tracecompass.incubator.callstack.ui/src/org/eclipse/tracecompass/incubator/internal/callstack/ui/views/flamechart/FlameChartView.java @@ -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; @@ -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;