2828import java .util .Map ;
2929import java .util .Objects ;
3030import java .util .function .Function ;
31+ import java .util .logging .Level ;
32+ import java .util .logging .Logger ;
3133
3234import org .eclipse .core .runtime .IProgressMonitor ;
35+ import org .eclipse .core .runtime .IStatus ;
3336import org .eclipse .core .runtime .NullProgressMonitor ;
37+ import org .eclipse .core .runtime .Status ;
38+ import org .eclipse .core .runtime .jobs .Job ;
3439import org .eclipse .jdt .annotation .NonNull ;
3540import org .eclipse .jdt .annotation .Nullable ;
3641import org .eclipse .jface .action .Action ;
8489import org .eclipse .tracecompass .tmf .ui .widgets .timegraph .model .TimeGraphEntry ;
8590import org .eclipse .tracecompass .tmf .ui .widgets .timegraph .widgets .TimeGraphControl ;
8691import org .eclipse .tracecompass .tmf .ui .widgets .timegraph .widgets .Utils ;
92+ import org .eclipse .tracecompass .traceeventlogger .LogUtils .FlowScopeLog ;
93+ import org .eclipse .tracecompass .traceeventlogger .LogUtils .FlowScopeLogBuilder ;
8794import org .eclipse .ui .IEditorPart ;
8895import org .eclipse .ui .IWorkbenchActionConstants ;
8996
@@ -105,6 +112,7 @@ public class FlameChartView extends BaseDataProviderTimeGraphView {
105112
106113 /** View ID. */
107114 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.callstack" ; //$NON-NLS-1$
115+ private static final Logger LOGGER = Logger .getLogger (FlameChartView .class .getName ());
108116
109117 private static final String [] COLUMN_NAMES = new String [] {
110118 Messages .CallStackView_FunctionColumn ,
@@ -740,13 +748,13 @@ private void updateConfigureSymbolsAction() {
740748 getConfigureSymbolsAction ().setEnabled (providerPages .length > 0 );
741749 }
742750
743- private void resetSymbols () {
751+ private IStatus resetSymbolsSync () {
744752 List <TimeGraphEntry > traceEntries = getEntryList (getTrace ());
745753 if (traceEntries != null ) {
746754 for (TraceEntry traceEntry : Iterables .filter (traceEntries , TraceEntry .class )) {
747755 ITimeGraphDataProvider <? extends TimeGraphEntryModel > provider = traceEntry .getProvider ();
748- if (provider instanceof CallStackDataProvider ) {
749- (( CallStackDataProvider ) provider ) .resetFunctionNames (new NullProgressMonitor ());
756+ if (provider instanceof CallStackDataProvider callstackProvider ) {
757+ callstackProvider .resetFunctionNames (new NullProgressMonitor ());
750758 }
751759
752760 // reset full and zoomed events here
@@ -763,7 +771,22 @@ private void resetSymbols() {
763771 refresh ();
764772 }
765773 synchingToTime (getTimeGraphViewer ().getSelectionBegin ());
774+ return Status .OK_STATUS ;
766775 }
776+
777+ private void resetSymbols () {
778+ try (FlowScopeLog flowParent = new FlowScopeLogBuilder (LOGGER , Level .FINE , "Resetting Symbols - Job launch" ).setCategory ("Flame Chart" ).build ();) { //$NON-NLS-1$ //$NON-NLS-2$
779+ new Job ("Resetting Symbols" ) { //$NON-NLS-1$
780+ @ Override
781+ protected IStatus run (@ Nullable IProgressMonitor monitor ) {
782+ try (FlowScopeLog log = new FlowScopeLogBuilder (LOGGER , Level .FINE , "Resetting Symbols" ).setParentScope (flowParent ).build ()) { //$NON-NLS-1$
783+ return resetSymbolsSync ();
784+ }
785+ }
786+ }.schedule ();
787+ }
788+ }
789+
767790 @ TmfSignalHandler
768791 @ Override
769792 public void traceClosed (@ Nullable TmfTraceClosedSignal signal ) {
0 commit comments