1 /*******************************************************************************
2 * Copyright (c) 2013, 2016 Ericsson and others.
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Patrick Tasse - Initial API and implementation
11 * Bernd Hufmann - Updated signal handling
12 * Marc-Andre Laperle - Map from binary file
13 *******************************************************************************/
15 package org
.eclipse
.tracecompass
.tmf
.ui
.views
.callstack
;
17 import java
.util
.ArrayList
;
18 import java
.util
.Collections
;
19 import java
.util
.Comparator
;
20 import java
.util
.HashMap
;
21 import java
.util
.Iterator
;
22 import java
.util
.List
;
25 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
26 import org
.eclipse
.jdt
.annotation
.NonNull
;
27 import org
.eclipse
.jdt
.annotation
.Nullable
;
28 import org
.eclipse
.jface
.action
.Action
;
29 import org
.eclipse
.jface
.action
.GroupMarker
;
30 import org
.eclipse
.jface
.action
.IAction
;
31 import org
.eclipse
.jface
.action
.IMenuManager
;
32 import org
.eclipse
.jface
.action
.IToolBarManager
;
33 import org
.eclipse
.jface
.action
.Separator
;
34 import org
.eclipse
.jface
.dialogs
.IDialogConstants
;
35 import org
.eclipse
.jface
.dialogs
.IDialogSettings
;
36 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
37 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
38 import org
.eclipse
.jface
.util
.PropertyChangeEvent
;
39 import org
.eclipse
.jface
.viewers
.DoubleClickEvent
;
40 import org
.eclipse
.jface
.viewers
.IDoubleClickListener
;
41 import org
.eclipse
.jface
.viewers
.ISelection
;
42 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
43 import org
.eclipse
.swt
.SWT
;
44 import org
.eclipse
.swt
.events
.MouseAdapter
;
45 import org
.eclipse
.swt
.events
.MouseEvent
;
46 import org
.eclipse
.swt
.graphics
.Image
;
47 import org
.eclipse
.swt
.widgets
.Composite
;
48 import org
.eclipse
.swt
.widgets
.Display
;
49 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.Activator
;
50 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.ITmfImageConstants
;
51 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.Messages
;
52 import org
.eclipse
.tracecompass
.statesystem
.core
.ITmfStateSystem
;
53 import org
.eclipse
.tracecompass
.statesystem
.core
.StateSystemUtils
;
54 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.AttributeNotFoundException
;
55 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.StateSystemDisposedException
;
56 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.StateValueTypeException
;
57 import org
.eclipse
.tracecompass
.statesystem
.core
.exceptions
.TimeRangeException
;
58 import org
.eclipse
.tracecompass
.statesystem
.core
.interval
.ITmfStateInterval
;
59 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
;
60 import org
.eclipse
.tracecompass
.statesystem
.core
.statevalue
.ITmfStateValue
.Type
;
61 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfSelectionRangeUpdatedSignal
;
62 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfSignalHandler
;
63 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfTraceClosedSignal
;
64 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfTraceSelectedSignal
;
65 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfWindowRangeUpdatedSignal
;
66 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.ITmfTimestamp
;
67 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimeRange
;
68 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimestampDelta
;
69 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimestamp
;
70 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
71 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTraceUtils
;
72 import org
.eclipse
.tracecompass
.tmf
.ui
.editors
.ITmfTraceEditor
;
73 import org
.eclipse
.tracecompass
.tmf
.ui
.symbols
.ISymbolProvider
;
74 import org
.eclipse
.tracecompass
.tmf
.ui
.symbols
.ISymbolProviderPreferencePage
;
75 import org
.eclipse
.tracecompass
.tmf
.ui
.symbols
.SymbolProviderConfigDialog
;
76 import org
.eclipse
.tracecompass
.tmf
.ui
.symbols
.SymbolProviderManager
;
77 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.timegraph
.AbstractTimeGraphView
;
78 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.ITimeGraphTimeListener
;
79 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.TimeGraphContentProvider
;
80 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.TimeGraphTimeEvent
;
81 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.TimeGraphViewer
;
82 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
83 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
84 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.NullTimeEvent
;
85 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.TimeEvent
;
86 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.TimeGraphEntry
;
87 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeGraphControl
;
88 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeGraphSelection
;
89 import org
.eclipse
.ui
.IEditorPart
;
90 import org
.eclipse
.ui
.IWorkbenchActionConstants
;
93 * Main implementation for the Call Stack view
95 * @author Patrick Tasse
97 public class CallStackView
extends AbstractTimeGraphView
{
99 // ------------------------------------------------------------------------
101 // ------------------------------------------------------------------------
104 public static final String ID
= "org.eclipse.linuxtools.tmf.ui.views.callstack"; //$NON-NLS-1$
106 private static final String
[] COLUMN_NAMES
= new String
[] {
107 Messages
.CallStackView_FunctionColumn
,
108 Messages
.CallStackView_DepthColumn
,
109 Messages
.CallStackView_EntryTimeColumn
,
110 Messages
.CallStackView_ExitTimeColumn
,
111 Messages
.CallStackView_DurationColumn
114 private static final String
[] FILTER_COLUMN_NAMES
= new String
[] {
115 Messages
.CallStackView_ThreadColumn
118 /** Timeout between updates in the build thread in ms */
119 private static final long BUILD_UPDATE_TIMEOUT
= 500;
121 // Fraction of a function duration to be added as spacing
122 private static final double SPACING_RATIO
= 0.01;
124 private static final Image THREAD_IMAGE
= Activator
.getDefault().getImageFromPath("icons/obj16/thread_obj.gif"); //$NON-NLS-1$
125 private static final Image STACKFRAME_IMAGE
= Activator
.getDefault().getImageFromPath("icons/obj16/stckframe_obj.gif"); //$NON-NLS-1$
127 private static final String IMPORT_BINARY_ICON_PATH
= "icons/obj16/binaries_obj.gif"; //$NON-NLS-1$
129 private static final ImageDescriptor SORT_BY_NAME_ICON
= Activator
.getDefault().getImageDescripterFromPath("icons/etool16/sort_alpha.gif"); //$NON-NLS-1$
130 private static final ImageDescriptor SORT_BY_NAME_REV_ICON
= Activator
.getDefault().getImageDescripterFromPath("icons/etool16/sort_alpha_rev.gif"); //$NON-NLS-1$
131 private static final ImageDescriptor SORT_BY_ID_ICON
= Activator
.getDefault().getImageDescripterFromPath("icons/etool16/sort_num.gif"); //$NON-NLS-1$
132 private static final ImageDescriptor SORT_BY_ID_REV_ICON
= Activator
.getDefault().getImageDescripterFromPath("icons/etool16/sort_num_rev.gif"); //$NON-NLS-1$
133 private static final ImageDescriptor SORT_BY_TIME_ICON
= Activator
.getDefault().getImageDescripterFromPath("icons/etool16/sort_time.gif"); //$NON-NLS-1$
134 private static final ImageDescriptor SORT_BY_TIME_REV_ICON
= Activator
.getDefault().getImageDescripterFromPath("icons/etool16/sort_time_rev.gif"); //$NON-NLS-1$
135 private static final String SORT_OPTION_KEY
= "sort.option"; //$NON-NLS-1$
137 private enum SortOption
{
138 BY_NAME
, BY_NAME_REV
, BY_ID
, BY_ID_REV
, BY_TIME
, BY_TIME_REV
141 private @NonNull SortOption fSortOption
= SortOption
.BY_NAME
;
142 private @NonNull Comparator
<ITimeGraphEntry
> fThreadComparator
= new ThreadNameComparator(false);
143 private Action fSortByNameAction
;
144 private Action fSortByIdAction
;
145 private Action fSortByTimeAction
;
147 // ------------------------------------------------------------------------
149 // ------------------------------------------------------------------------
151 private final Map
<ITmfTrace
, ISymbolProvider
> fSymbolProviders
= new HashMap
<>();
153 // The next event action
154 private Action fNextEventAction
;
156 // The previous event action
157 private Action fPrevEventAction
;
159 // The next item action
160 private Action fNextItemAction
;
162 // The previous item action
163 private Action fPreviousItemAction
;
165 // The action to import a binary file mapping */
166 private Action fConfigureSymbolsAction
;
168 // The saved time sync. signal used when switching off the pinning of a view
169 private TmfSelectionRangeUpdatedSignal fSavedTimeSyncSignal
;
171 // The saved window range signal used when switching off the pinning of
173 private TmfWindowRangeUpdatedSignal fSavedRangeSyncSignal
;
175 // ------------------------------------------------------------------------
177 // ------------------------------------------------------------------------
179 private static class TraceEntry
extends TimeGraphEntry
{
180 public TraceEntry(String name
, long startTime
, long endTime
) {
181 super(name
, startTime
, endTime
);
185 public boolean hasTimeEvents() {
190 private static class ThreadEntry
extends TimeGraphEntry
{
191 // The call stack quark
192 private final int fCallStackQuark
;
193 // The state system from which this entry comes
194 private final ITmfStateSystem fSS
;
196 private final long fThreadId
;
198 public ThreadEntry(ITmfStateSystem ss
, String name
, long threadId
, int callStackQuark
, long startTime
, long endTime
) {
199 super(name
, startTime
, endTime
);
200 fCallStackQuark
= callStackQuark
;
201 fThreadId
= threadId
;
206 public boolean hasTimeEvents() {
210 public int getCallStackQuark() {
211 return fCallStackQuark
;
214 public long getThreadId() {
219 public ITmfStateSystem
getStateSystem() {
224 private class CallStackComparator
implements Comparator
<ITimeGraphEntry
> {
226 public int compare(ITimeGraphEntry o1
, ITimeGraphEntry o2
) {
227 if (o1
instanceof ThreadEntry
&& o2
instanceof ThreadEntry
) {
228 return fThreadComparator
.compare(o1
, o2
);
234 private static class ThreadNameComparator
implements Comparator
<ITimeGraphEntry
> {
235 private boolean reverse
;
237 public ThreadNameComparator(boolean reverse
) {
238 this.reverse
= reverse
;
242 public int compare(ITimeGraphEntry o1
, ITimeGraphEntry o2
) {
243 return reverse ? o2
.getName().compareTo(o1
.getName()) :
244 o1
.getName().compareTo(o2
.getName());
248 private static class ThreadIdComparator
implements Comparator
<ITimeGraphEntry
> {
249 private boolean reverse
;
251 public ThreadIdComparator(boolean reverse
) {
252 this.reverse
= reverse
;
256 public int compare(ITimeGraphEntry o1
, ITimeGraphEntry o2
) {
257 ThreadEntry t1
= (ThreadEntry
) o1
;
258 ThreadEntry t2
= (ThreadEntry
) o2
;
259 return reverse ? Long
.compare(t2
.getThreadId(), t1
.getThreadId()) :
260 Long
.compare(t1
.getThreadId(), t2
.getThreadId());
264 private static class ThreadTimeComparator
implements Comparator
<ITimeGraphEntry
> {
265 private boolean reverse
;
267 public ThreadTimeComparator(boolean reverse
) {
268 this.reverse
= reverse
;
272 public int compare(ITimeGraphEntry o1
, ITimeGraphEntry o2
) {
273 return reverse ? Long
.compare(o2
.getStartTime(), o1
.getStartTime()) :
274 Long
.compare(o1
.getStartTime(), o2
.getStartTime());
278 private static class CallStackTreeLabelProvider
extends TreeLabelProvider
{
281 public Image
getColumnImage(Object element
, int columnIndex
) {
282 if (columnIndex
== 0) {
283 if (element
instanceof ThreadEntry
) {
285 } else if (element
instanceof CallStackEntry
) {
286 CallStackEntry entry
= (CallStackEntry
) element
;
287 if (entry
.getFunctionName().length() > 0) {
288 return STACKFRAME_IMAGE
;
296 public String
getColumnText(Object element
, int columnIndex
) {
297 if (element
instanceof CallStackEntry
) {
298 CallStackEntry entry
= (CallStackEntry
) element
;
299 if (columnIndex
== 0) {
300 return entry
.getFunctionName();
301 } else if (columnIndex
== 1 && entry
.getFunctionName().length() > 0) {
302 int depth
= entry
.getStackLevel();
303 return Integer
.toString(depth
);
304 } else if (columnIndex
== 2 && entry
.getFunctionName().length() > 0) {
305 ITmfTimestamp ts
= TmfTimestamp
.fromNanos(entry
.getFunctionEntryTime());
306 return ts
.toString();
307 } else if (columnIndex
== 3 && entry
.getFunctionName().length() > 0) {
308 ITmfTimestamp ts
= TmfTimestamp
.fromNanos(entry
.getFunctionExitTime());
309 return ts
.toString();
310 } else if (columnIndex
== 4 && entry
.getFunctionName().length() > 0) {
311 ITmfTimestamp ts
= new TmfTimestampDelta(entry
.getFunctionExitTime() - entry
.getFunctionEntryTime(), ITmfTimestamp
.NANOSECOND_SCALE
);
312 return ts
.toString();
314 } else if (element
instanceof ITimeGraphEntry
) {
315 if (columnIndex
== 0) {
316 return ((ITimeGraphEntry
) element
).getName();
319 return ""; //$NON-NLS-1$
324 private class CallStackFilterContentProvider
extends TimeGraphContentProvider
{
326 public boolean hasChildren(Object element
) {
327 if (element
instanceof TraceEntry
) {
328 return super.hasChildren(element
);
334 public ITimeGraphEntry
[] getChildren(Object parentElement
) {
335 if (parentElement
instanceof TraceEntry
) {
336 return super.getChildren(parentElement
);
338 return new ITimeGraphEntry
[0];
342 // ------------------------------------------------------------------------
344 // ------------------------------------------------------------------------
347 * Default constructor
349 public CallStackView() {
350 super(ID
, new CallStackPresentationProvider());
351 ((CallStackPresentationProvider
) getPresentationProvider()).setCallStackView(this);
352 setTreeColumns(COLUMN_NAMES
);
353 setTreeLabelProvider(new CallStackTreeLabelProvider());
354 setEntryComparator(new CallStackComparator());
355 setFilterColumns(FILTER_COLUMN_NAMES
);
356 setFilterContentProvider(new CallStackFilterContentProvider());
357 setFilterLabelProvider(new CallStackTreeLabelProvider());
360 // ------------------------------------------------------------------------
362 // ------------------------------------------------------------------------
365 public void createPartControl(Composite parent
) {
366 super.createPartControl(parent
);
368 getTimeGraphViewer().addTimeListener(new ITimeGraphTimeListener() {
370 public void timeSelected(TimeGraphTimeEvent event
) {
371 synchingToTime(event
.getBeginTime());
375 getTimeGraphCombo().getTreeViewer().addDoubleClickListener(new IDoubleClickListener() {
377 public void doubleClick(DoubleClickEvent event
) {
378 Object selection
= ((IStructuredSelection
) event
.getSelection()).getFirstElement();
379 if (selection
instanceof CallStackEntry
) {
380 CallStackEntry entry
= (CallStackEntry
) selection
;
381 if (entry
.getFunctionName().length() > 0) {
382 long entryTime
= entry
.getFunctionEntryTime();
383 long exitTime
= entry
.getFunctionExitTime();
384 long spacingTime
= (long) ((exitTime
- entryTime
) * SPACING_RATIO
);
385 entryTime
-= spacingTime
;
386 exitTime
+= spacingTime
;
387 TmfTimeRange range
= new TmfTimeRange(TmfTimestamp
.fromNanos(entryTime
), TmfTimestamp
.fromNanos(exitTime
));
388 broadcast(new TmfWindowRangeUpdatedSignal(CallStackView
.this, range
));
389 getTimeGraphViewer().setStartFinishTime(entryTime
, exitTime
);
390 startZoomThread(entryTime
, exitTime
);
396 getTimeGraphViewer().getTimeGraphControl().addMouseListener(new MouseAdapter() {
398 public void mouseDoubleClick(MouseEvent e
) {
399 TimeGraphControl timeGraphControl
= getTimeGraphViewer().getTimeGraphControl();
400 ISelection selection
= timeGraphControl
.getSelection();
401 if (selection
instanceof TimeGraphSelection
) {
402 Object o
= ((TimeGraphSelection
) selection
).getFirstElement();
403 if (o
instanceof CallStackEvent
) {
404 CallStackEvent event
= (CallStackEvent
) o
;
405 long startTime
= event
.getTime();
406 long endTime
= startTime
+ event
.getDuration();
407 long spacingTime
= (long) ((endTime
- startTime
) * SPACING_RATIO
);
408 startTime
-= spacingTime
;
409 endTime
+= spacingTime
;
410 TmfTimeRange range
= new TmfTimeRange(TmfTimestamp
.fromNanos(startTime
), TmfTimestamp
.fromNanos(endTime
));
411 broadcast(new TmfWindowRangeUpdatedSignal(CallStackView
.this, range
));
412 getTimeGraphViewer().setStartFinishTime(startTime
, endTime
);
413 startZoomThread(startTime
, endTime
);
419 contributeToActionBars();
422 IEditorPart editor
= getSite().getPage().getActiveEditor();
423 if (editor
instanceof ITmfTraceEditor
) {
424 ITmfTrace trace
= ((ITmfTraceEditor
) editor
).getTrace();
426 traceSelected(new TmfTraceSelectedSignal(this, trace
));
432 * Handler for the selection range signal.
435 * The incoming signal
440 public void selectionRangeUpdated(final TmfSelectionRangeUpdatedSignal signal
) {
442 fSavedTimeSyncSignal
= isPinned() ?
new TmfSelectionRangeUpdatedSignal(signal
.getSource(), signal
.getBeginTime(), signal
.getEndTime()) : null;
444 if (signal
.getSource() == this || getTrace() == null || isPinned()) {
447 final long beginTime
= signal
.getBeginTime().toNanos();
448 final long endTime
= signal
.getEndTime().toNanos();
449 Display
.getDefault().asyncExec(new Runnable() {
452 if (getTimeGraphCombo().isDisposed()) {
455 if (beginTime
== endTime
) {
456 getTimeGraphViewer().setSelectedTime(beginTime
, true);
458 getTimeGraphViewer().setSelectionRange(beginTime
, endTime
, true);
460 synchingToTime(beginTime
);
461 startZoomThread(getTimeGraphViewer().getTime0(), getTimeGraphViewer().getTime1());
462 List
<TimeGraphEntry
> entryList
= getEntryList(getTrace());
463 if (entryList
== null) {
466 TimeGraphViewer viewer
= getTimeGraphViewer();
467 for (TimeGraphEntry traceEntry
: entryList
) {
468 for (ITimeGraphEntry child
: traceEntry
.getChildren()) {
469 ThreadEntry threadEntry
= (ThreadEntry
) child
;
470 ITmfStateSystem ss
= threadEntry
.getStateSystem();
471 if (ss
== null || beginTime
< ss
.getStartTime() || beginTime
> ss
.getCurrentEndTime()) {
475 int quark
= threadEntry
.getCallStackQuark();
476 ITmfStateInterval stackInterval
= ss
.querySingleState(beginTime
, quark
);
477 if (beginTime
== stackInterval
.getStartTime()) {
478 int stackLevel
= stackInterval
.getStateValue().unboxInt();
479 ITimeGraphEntry selectedEntry
= threadEntry
.getChildren().get(Math
.max(0, stackLevel
- 1));
480 getTimeGraphCombo().setSelection(selectedEntry
);
481 viewer
.getTimeGraphControl().fireSelectionChanged();
484 } catch (AttributeNotFoundException
| TimeRangeException
| StateSystemDisposedException
| StateValueTypeException e
) {
485 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
498 public void windowRangeUpdated(final TmfWindowRangeUpdatedSignal signal
) {
501 fSavedRangeSyncSignal
= new TmfWindowRangeUpdatedSignal(signal
.getSource(), signal
.getCurrentRange());
502 fSavedTimeSyncSignal
= null;
505 if ((signal
.getSource() == this) || isPinned()) {
508 super.windowRangeUpdated(signal
);
511 // ------------------------------------------------------------------------
513 // ------------------------------------------------------------------------
517 public void traceClosed(TmfTraceClosedSignal signal
) {
518 super.traceClosed(signal
);
519 synchronized(fSymbolProviders
){
520 for(ITmfTrace trace
: getTracesToBuild(signal
.getTrace())){
521 fSymbolProviders
.remove(trace
);
530 protected void refresh() {
532 updateConfigureSymbolsAction();
536 protected void buildEntryList(final ITmfTrace trace
, final ITmfTrace parentTrace
, final IProgressMonitor monitor
) {
537 if (monitor
.isCanceled()) {
540 AbstractCallStackAnalysis module
= getCallStackModule(trace
);
541 if (module
== null) {
542 addUnavailableEntry(trace
, parentTrace
);
545 ITmfStateSystem ss
= module
.getStateSystem();
547 addUnavailableEntry(trace
, parentTrace
);
551 Map
<ITmfTrace
, TraceEntry
> traceEntryMap
= new HashMap
<>();
552 Map
<Integer
, ThreadEntry
> threadEntryMap
= new HashMap
<>();
553 String
[] threadPaths
= module
.getThreadsPattern();
555 long start
= ss
.getStartTime();
557 boolean complete
= false;
559 if (monitor
.isCanceled()) {
562 complete
= ss
.waitUntilBuilt(BUILD_UPDATE_TIMEOUT
);
563 if (ss
.isCancelled()) {
566 long end
= ss
.getCurrentEndTime();
567 if (start
== end
&& !complete
) { // when complete execute one last time regardless of end time
571 ISymbolProvider provider
= fSymbolProviders
.get(trace
);
572 if (provider
== null) {
573 provider
= SymbolProviderManager
.getInstance().getSymbolProvider(trace
);
574 provider
.loadConfiguration(monitor
);
575 fSymbolProviders
.put(trace
, provider
);
578 getConfigureSymbolsAction().setEnabled(true);
580 List
<Integer
> threadQuarks
= ss
.getQuarks(threadPaths
);
581 TraceEntry traceEntry
= traceEntryMap
.get(trace
);
582 if (traceEntry
== null) {
583 traceEntry
= new TraceEntry(trace
.getName(), start
, end
+ 1);
584 traceEntryMap
.put(trace
, traceEntry
);
585 traceEntry
.sortChildren(fThreadComparator
);
586 addToEntryList(parentTrace
, Collections
.singletonList(traceEntry
));
588 traceEntry
.updateEndTime(end
);
592 /* Only query startStates if necessary (threadEntry == null)*/
593 List
<ITmfStateInterval
> startStates
= null;
594 List
<ITmfStateInterval
> endStates
= ss
.queryFullState(ss
.getCurrentEndTime());
595 for (int i
= 0; i
< threadQuarks
.size(); i
++) {
596 if (monitor
.isCanceled()) {
599 int threadQuark
= threadQuarks
.get(i
);
600 String
[] callStackPath
= module
.getCallStackPath();
601 int callStackQuark
= ss
.getQuarkRelative(threadQuark
, callStackPath
);
602 String threadName
= ss
.getAttributeName(threadQuark
);
603 long threadEnd
= end
+ 1;
604 ITmfStateInterval endInterval
= endStates
.get(callStackQuark
);
605 if (endInterval
.getStateValue().isNull() && endInterval
.getStartTime() != ss
.getStartTime()) {
606 threadEnd
= endInterval
.getStartTime();
608 ThreadEntry threadEntry
= threadEntryMap
.get(threadQuark
);
609 if (threadEntry
== null) {
610 if (startStates
== null) {
611 startStates
= ss
.queryFullState(ss
.getStartTime());
613 long threadId
= endInterval
.getStateValue().unboxLong();
614 long threadStart
= start
;
615 ITmfStateInterval startInterval
= startStates
.get(callStackQuark
);
616 if (startInterval
.getStateValue().isNull()) {
617 threadStart
= Math
.min(startInterval
.getEndTime() + 1, end
+ 1);
619 threadEntry
= new ThreadEntry(ss
, threadName
, threadId
, callStackQuark
, threadStart
, threadEnd
);
620 threadEntryMap
.put(threadQuark
, threadEntry
);
621 traceEntry
.addChild(threadEntry
);
623 threadEntry
.updateEndTime(threadEnd
);
626 for (int stackLevelQuark
: ss
.getSubAttributes(callStackQuark
, false)) {
627 if (level
> threadEntry
.getChildren().size()) {
628 CallStackEntry callStackEntry
= new CallStackEntry(threadName
, stackLevelQuark
, level
, trace
, ss
);
629 threadEntry
.addChild(callStackEntry
);
634 } catch (AttributeNotFoundException e
) {
635 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
636 } catch (StateSystemDisposedException e
) {
639 if (parentTrace
== getTrace()) {
640 synchronized (this) {
641 setStartTime(getStartTime() == SWT
.DEFAULT ? start
: Math
.min(getStartTime(), start
));
642 setEndTime(getEndTime() == SWT
.DEFAULT ? end
+ 1 : Math
.max(getEndTime(), end
+ 1));
644 synchingToTime(getTimeGraphViewer().getSelectionBegin());
647 for (ITimeGraphEntry threadEntry
: traceEntry
.getChildren()) {
648 for (ITimeGraphEntry callStackEntry
: threadEntry
.getChildren()) {
649 if (monitor
.isCanceled()) {
652 buildStatusEvents(parentTrace
, (CallStackEntry
) callStackEntry
, monitor
, ss
.getStartTime(), end
);
659 private void addUnavailableEntry(ITmfTrace trace
, ITmfTrace parentTrace
) {
660 String name
= Messages
.CallStackView_StackInfoNotAvailable
+ ' ' + '(' + trace
.getName() + ')';
661 TraceEntry unavailableEntry
= new TraceEntry(name
, 0, 0);
662 addToEntryList(parentTrace
, Collections
.singletonList(unavailableEntry
));
663 if (parentTrace
== getTrace()) {
668 private void buildStatusEvents(ITmfTrace trace
, CallStackEntry entry
, @NonNull IProgressMonitor monitor
, long start
, long end
) {
669 ITmfStateSystem ss
= entry
.getStateSystem();
670 long resolution
= Math
.max(1, (end
- ss
.getStartTime()) / getDisplayWidth());
671 List
<ITimeEvent
> eventList
= getEventList(entry
, start
, end
+ 1, resolution
, monitor
);
672 if (eventList
!= null) {
673 entry
.setEventList(eventList
);
675 if (trace
== getTrace()) {
684 protected final List
<ITimeEvent
> getEventList(TimeGraphEntry tgentry
, long startTime
, long endTime
, long resolution
, IProgressMonitor monitor
) {
685 if (!(tgentry
instanceof CallStackEntry
)) {
688 CallStackEntry entry
= (CallStackEntry
) tgentry
;
689 ITmfStateSystem ss
= entry
.getStateSystem();
690 long start
= Math
.max(startTime
, ss
.getStartTime());
691 long end
= Math
.min(endTime
, ss
.getCurrentEndTime() + 1);
695 boolean isZoomThread
= Thread
.currentThread() instanceof ZoomThread
;
696 List
<ITimeEvent
> eventList
= null;
698 List
<ITmfStateInterval
> stackIntervals
= StateSystemUtils
.queryHistoryRange(ss
, entry
.getQuark(), start
, end
- 1, resolution
, monitor
);
699 eventList
= new ArrayList
<>(stackIntervals
.size());
700 long lastEndTime
= -1;
701 boolean lastIsNull
= true;
702 for (ITmfStateInterval statusInterval
: stackIntervals
) {
703 if (monitor
.isCanceled()) {
706 long time
= statusInterval
.getStartTime();
707 long duration
= statusInterval
.getEndTime() - time
+ 1;
708 if (!statusInterval
.getStateValue().isNull()) {
709 final int modulo
= CallStackPresentationProvider
.NUM_COLORS
/ 2;
710 int value
= statusInterval
.getStateValue().toString().hashCode() % modulo
+ modulo
;
711 eventList
.add(new CallStackEvent(entry
, time
, duration
, value
));
714 if (lastEndTime
== -1 && isZoomThread
) {
715 // add null event if it intersects the start time
716 eventList
.add(new NullTimeEvent(entry
, time
, duration
));
718 if (lastEndTime
!= time
&& lastIsNull
) {
719 // add unknown event if between two null states
720 eventList
.add(new TimeEvent(entry
, lastEndTime
, time
- lastEndTime
));
722 if (time
+ duration
>= endTime
&& isZoomThread
) {
723 // add null event if it intersects the end time
724 eventList
.add(new NullTimeEvent(entry
, time
, duration
));
729 lastEndTime
= time
+ duration
;
731 } catch (AttributeNotFoundException e
) {
732 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
733 } catch (TimeRangeException e
) {
734 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
735 } catch (StateSystemDisposedException e
) {
745 protected void synchingToTime(long time
) {
746 List
<TimeGraphEntry
> entryList
= getEntryList(getTrace());
747 if (entryList
== null) {
750 for (TimeGraphEntry traceEntry
: entryList
) {
751 for (ITimeGraphEntry threadEntry
: traceEntry
.getChildren()) {
752 ITmfStateSystem ss
= ((ThreadEntry
) threadEntry
).getStateSystem();
756 if (ss
.isCancelled()) {
759 if (time
< ss
.getStartTime() || time
> ss
.getCurrentEndTime()) {
762 for (ITimeGraphEntry child
: threadEntry
.getChildren()) {
763 CallStackEntry callStackEntry
= (CallStackEntry
) child
;
764 ITmfTrace trace
= callStackEntry
.getTrace();
766 ITmfStateInterval stackLevelInterval
= ss
.querySingleState(time
, callStackEntry
.getQuark());
767 ITmfStateValue nameValue
= stackLevelInterval
.getStateValue();
768 String name
= getFunctionName(trace
, nameValue
);
769 callStackEntry
.setFunctionName(name
);
770 if (name
.length() > 0) {
771 callStackEntry
.setFunctionEntryTime(stackLevelInterval
.getStartTime());
772 callStackEntry
.setFunctionExitTime(stackLevelInterval
.getEndTime() + 1);
774 } catch (AttributeNotFoundException e
) {
775 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
776 } catch (StateSystemDisposedException e
) {
782 if (Display
.getCurrent() != null) {
783 getTimeGraphCombo().refresh();
787 String
getFunctionName(ITmfTrace trace
, ITmfStateValue nameValue
) {
788 long address
= Long
.MAX_VALUE
;
789 String name
= ""; //$NON-NLS-1$
791 if (nameValue
.getType() == Type
.STRING
) {
792 name
= nameValue
.unboxStr();
794 address
= Long
.parseLong(name
, 16);
795 } catch (NumberFormatException e
) {
798 } else if (nameValue
.getType() == Type
.INTEGER
) {
799 name
= "0x" + Integer
.toHexString(nameValue
.unboxInt()); //$NON-NLS-1$
800 address
= nameValue
.unboxInt();
801 } else if (nameValue
.getType() == Type
.LONG
) {
802 name
= "0x" + Long
.toHexString(nameValue
.unboxLong()); //$NON-NLS-1$
803 address
= nameValue
.unboxLong();
805 } catch (StateValueTypeException e
) {
807 if (address
!= Long
.MAX_VALUE
) {
808 ISymbolProvider provider
= fSymbolProviders
.get(trace
);
809 if (provider
!= null) {
810 String symbol
= provider
.getSymbolText(address
);
811 if (symbol
!= null) {
819 private void makeActions() {
820 fPreviousItemAction
= getTimeGraphViewer().getPreviousItemAction();
821 fPreviousItemAction
.setText(Messages
.TmfTimeGraphViewer_PreviousItemActionNameText
);
822 fPreviousItemAction
.setToolTipText(Messages
.TmfTimeGraphViewer_PreviousItemActionToolTipText
);
823 fNextItemAction
= getTimeGraphViewer().getNextItemAction();
824 fNextItemAction
.setText(Messages
.TmfTimeGraphViewer_NextItemActionNameText
);
825 fNextItemAction
.setToolTipText(Messages
.TmfTimeGraphViewer_NextItemActionToolTipText
);
828 private void contributeToActionBars() {
830 contributePinActionToToolBar();
831 fPinAction
.addPropertyChangeListener(new IPropertyChangeListener() {
833 public void propertyChange(PropertyChangeEvent event
) {
834 if (IAction
.CHECKED
.equals(event
.getProperty()) && !isPinned()) {
835 if (fSavedRangeSyncSignal
!= null) {
836 windowRangeUpdated(fSavedRangeSyncSignal
);
837 fSavedRangeSyncSignal
= null;
840 if (fSavedTimeSyncSignal
!= null) {
841 selectionRangeUpdated(fSavedTimeSyncSignal
);
842 fSavedTimeSyncSignal
= null;
853 protected void fillLocalToolBar(IToolBarManager manager
) {
855 manager
.add(getConfigureSymbolsAction());
856 manager
.add(new Separator());
857 manager
.add(getSortByNameAction());
858 manager
.add(getSortByIdAction());
859 manager
.add(getSortByTimeAction());
860 manager
.add(new Separator());
861 manager
.add(getTimeGraphCombo().getShowFilterDialogAction());
862 manager
.add(new Separator());
863 manager
.add(getTimeGraphViewer().getResetScaleAction());
864 manager
.add(getPreviousEventAction());
865 manager
.add(getNextEventAction());
866 manager
.add(new Separator());
867 manager
.add(getTimeGraphViewer().getToggleBookmarkAction());
868 manager
.add(getTimeGraphViewer().getPreviousMarkerAction());
869 manager
.add(getTimeGraphViewer().getNextMarkerAction());
870 manager
.add(new Separator());
871 manager
.add(fPreviousItemAction
);
872 manager
.add(fNextItemAction
);
873 manager
.add(getTimeGraphViewer().getZoomInAction());
874 manager
.add(getTimeGraphViewer().getZoomOutAction());
881 protected void fillTimeGraphEntryContextMenu(IMenuManager contextMenu
) {
882 contextMenu
.add(new GroupMarker(IWorkbenchActionConstants
.GROUP_REORGANIZE
));
883 contextMenu
.add(getSortByNameAction());
884 contextMenu
.add(getSortByIdAction());
885 contextMenu
.add(getSortByTimeAction());
889 * Get the the next event action.
891 * @return The action object
893 private Action
getNextEventAction() {
894 if (fNextEventAction
== null) {
895 fNextEventAction
= new Action() {
898 TimeGraphViewer viewer
= getTimeGraphViewer();
899 ITimeGraphEntry entry
= viewer
.getSelection();
900 if (entry
instanceof CallStackEntry
) {
902 CallStackEntry callStackEntry
= (CallStackEntry
) entry
;
903 ITmfStateSystem ss
= callStackEntry
.getStateSystem();
904 long time
= Math
.max(ss
.getStartTime(), Math
.min(ss
.getCurrentEndTime(), viewer
.getSelectionBegin()));
905 ThreadEntry threadEntry
= (ThreadEntry
) callStackEntry
.getParent();
906 int quark
= ss
.getParentAttributeQuark(callStackEntry
.getQuark());
907 ITmfStateInterval stackInterval
= ss
.querySingleState(time
, quark
);
908 long newTime
= stackInterval
.getEndTime() + 1;
909 viewer
.setSelectedTimeNotify(newTime
, true);
910 stackInterval
= ss
.querySingleState(Math
.min(ss
.getCurrentEndTime(), newTime
), quark
);
911 int stackLevel
= stackInterval
.getStateValue().unboxInt();
912 ITimeGraphEntry selectedEntry
= threadEntry
.getChildren().get(Math
.max(0, stackLevel
- 1));
913 getTimeGraphCombo().setSelection(selectedEntry
);
914 viewer
.getTimeGraphControl().fireSelectionChanged();
915 startZoomThread(viewer
.getTime0(), viewer
.getTime1());
917 } catch (AttributeNotFoundException
| TimeRangeException
| StateSystemDisposedException
| StateValueTypeException e
) {
918 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
924 fNextEventAction
.setText(Messages
.TmfTimeGraphViewer_NextEventActionNameText
);
925 fNextEventAction
.setToolTipText(Messages
.TmfTimeGraphViewer_NextEventActionToolTipText
);
926 fNextEventAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_NEXT_EVENT
));
929 return fNextEventAction
;
933 * Get the previous event action.
935 * @return The Action object
937 private Action
getPreviousEventAction() {
938 if (fPrevEventAction
== null) {
939 fPrevEventAction
= new Action() {
942 TimeGraphViewer viewer
= getTimeGraphCombo().getTimeGraphViewer();
943 ITimeGraphEntry entry
= viewer
.getSelection();
944 if (entry
instanceof CallStackEntry
) {
946 CallStackEntry callStackEntry
= (CallStackEntry
) entry
;
947 ITmfStateSystem ss
= callStackEntry
.getStateSystem();
948 long time
= Math
.max(ss
.getStartTime(), Math
.min(ss
.getCurrentEndTime(), viewer
.getSelectionBegin()));
949 ThreadEntry threadEntry
= (ThreadEntry
) callStackEntry
.getParent();
950 int quark
= ss
.getParentAttributeQuark(callStackEntry
.getQuark());
951 ITmfStateInterval stackInterval
= ss
.querySingleState(time
, quark
);
952 if (stackInterval
.getStartTime() == time
&& time
> ss
.getStartTime()) {
953 stackInterval
= ss
.querySingleState(time
- 1, quark
);
955 viewer
.setSelectedTimeNotify(stackInterval
.getStartTime(), true);
956 int stackLevel
= stackInterval
.getStateValue().unboxInt();
957 ITimeGraphEntry selectedEntry
= threadEntry
.getChildren().get(Math
.max(0, stackLevel
- 1));
958 getTimeGraphCombo().setSelection(selectedEntry
);
959 viewer
.getTimeGraphControl().fireSelectionChanged();
960 startZoomThread(viewer
.getTime0(), viewer
.getTime1());
962 } catch (AttributeNotFoundException
| TimeRangeException
| StateSystemDisposedException
| StateValueTypeException e
) {
963 Activator
.getDefault().logError("Error querying state system", e
); //$NON-NLS-1$
969 fPrevEventAction
.setText(Messages
.TmfTimeGraphViewer_PreviousEventActionNameText
);
970 fPrevEventAction
.setToolTipText(Messages
.TmfTimeGraphViewer_PreviousEventActionToolTipText
);
971 fPrevEventAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_PREV_EVENT
));
974 return fPrevEventAction
;
977 private static @Nullable AbstractCallStackAnalysis
getCallStackModule(@NonNull ITmfTrace trace
) {
979 * Since we cannot know the exact analysis ID (in separate plugins), we
980 * will search using the analysis type.
982 Iterable
<AbstractCallStackAnalysis
> modules
=
983 TmfTraceUtils
.getAnalysisModulesOfClass(trace
, AbstractCallStackAnalysis
.class);
984 Iterator
<AbstractCallStackAnalysis
> it
= modules
.iterator();
986 /* This trace does not provide a call-stack analysis */
991 * We only look at the first module we find.
993 * TODO Handle the advanced case where one trace provides more than one
994 * call-stack analysis.
996 AbstractCallStackAnalysis module
= it
.next();
997 /* This analysis is not automatic, we need to schedule it on-demand */
999 if (!module
.waitForInitialization()) {
1000 /* The initialization did not succeed */
1006 // ------------------------------------------------------------------------
1007 // Methods related to function name mapping
1008 // ------------------------------------------------------------------------
1010 private Action
getSortByNameAction() {
1011 if (fSortByNameAction
== null) {
1012 fSortByNameAction
= new Action(Messages
.CallStackView_SortByThreadName
, IAction
.AS_CHECK_BOX
) {
1015 if (fSortOption
== SortOption
.BY_NAME
) {
1016 saveSortOption(SortOption
.BY_NAME_REV
);
1018 saveSortOption(SortOption
.BY_NAME
);
1022 fSortByNameAction
.setToolTipText(Messages
.CallStackView_SortByThreadName
);
1023 fSortByNameAction
.setImageDescriptor(SORT_BY_NAME_ICON
);
1025 return fSortByNameAction
;
1028 private Action
getSortByIdAction() {
1029 if (fSortByIdAction
== null) {
1030 fSortByIdAction
= new Action(Messages
.CallStackView_SortByThreadId
, IAction
.AS_CHECK_BOX
) {
1033 if (fSortOption
== SortOption
.BY_ID
) {
1034 saveSortOption(SortOption
.BY_ID_REV
);
1036 saveSortOption(SortOption
.BY_ID
);
1040 fSortByIdAction
.setToolTipText(Messages
.CallStackView_SortByThreadId
);
1041 fSortByIdAction
.setImageDescriptor(SORT_BY_ID_ICON
);
1043 return fSortByIdAction
;
1046 private Action
getSortByTimeAction() {
1047 if (fSortByTimeAction
== null) {
1048 fSortByTimeAction
= new Action(Messages
.CallStackView_SortByThreadTime
, IAction
.AS_CHECK_BOX
) {
1051 if (fSortOption
== SortOption
.BY_TIME
) {
1052 saveSortOption(SortOption
.BY_TIME_REV
);
1054 saveSortOption(SortOption
.BY_TIME
);
1058 fSortByTimeAction
.setToolTipText(Messages
.CallStackView_SortByThreadTime
);
1059 fSortByTimeAction
.setImageDescriptor(SORT_BY_TIME_ICON
);
1061 return fSortByTimeAction
;
1064 private void loadSortOption() {
1065 IDialogSettings settings
= Activator
.getDefault().getDialogSettings();
1066 IDialogSettings section
= settings
.getSection(getClass().getName());
1067 if (section
== null) {
1070 String sortOption
= section
.get(SORT_OPTION_KEY
);
1071 if (sortOption
== null) {
1076 getSortByNameAction().setChecked(false);
1077 getSortByNameAction().setImageDescriptor(SORT_BY_NAME_ICON
);
1078 getSortByIdAction().setChecked(false);
1079 getSortByIdAction().setImageDescriptor(SORT_BY_ID_ICON
);
1080 getSortByTimeAction().setChecked(false);
1081 getSortByTimeAction().setImageDescriptor(SORT_BY_TIME_ICON
);
1083 if (sortOption
.equals(SortOption
.BY_NAME
.name())) {
1084 fSortOption
= SortOption
.BY_NAME
;
1085 fThreadComparator
= new ThreadNameComparator(false);
1086 getSortByNameAction().setChecked(true);
1087 } else if (sortOption
.equals(SortOption
.BY_NAME_REV
.name())) {
1088 fSortOption
= SortOption
.BY_NAME_REV
;
1089 fThreadComparator
= new ThreadNameComparator(true);
1090 getSortByNameAction().setChecked(true);
1091 getSortByNameAction().setImageDescriptor(SORT_BY_NAME_REV_ICON
);
1092 } else if (sortOption
.equals(SortOption
.BY_ID
.name())) {
1093 fSortOption
= SortOption
.BY_ID
;
1094 fThreadComparator
= new ThreadIdComparator(false);
1095 getSortByIdAction().setChecked(true);
1096 } else if (sortOption
.equals(SortOption
.BY_ID_REV
.name())) {
1097 fSortOption
= SortOption
.BY_ID_REV
;
1098 fThreadComparator
= new ThreadIdComparator(true);
1099 getSortByIdAction().setChecked(true);
1100 getSortByIdAction().setImageDescriptor(SORT_BY_ID_REV_ICON
);
1101 } else if (sortOption
.equals(SortOption
.BY_TIME
.name())) {
1102 fSortOption
= SortOption
.BY_TIME
;
1103 fThreadComparator
= new ThreadTimeComparator(false);
1104 getSortByTimeAction().setChecked(true);
1105 } else if (sortOption
.equals(SortOption
.BY_TIME_REV
.name())) {
1106 fSortOption
= SortOption
.BY_TIME_REV
;
1107 fThreadComparator
= new ThreadTimeComparator(true);
1108 getSortByTimeAction().setChecked(true);
1109 getSortByTimeAction().setImageDescriptor(SORT_BY_TIME_REV_ICON
);
1113 private void saveSortOption(SortOption sortOption
) {
1114 IDialogSettings settings
= Activator
.getDefault().getDialogSettings();
1115 IDialogSettings section
= settings
.getSection(getClass().getName());
1116 if (section
== null) {
1117 section
= settings
.addNewSection(getClass().getName());
1119 section
.put(SORT_OPTION_KEY
, sortOption
.name());
1121 List
<TimeGraphEntry
> entryList
= getEntryList(getTrace());
1122 if (entryList
== null) {
1125 for (TimeGraphEntry traceEntry
: entryList
) {
1126 traceEntry
.sortChildren(fThreadComparator
);
1131 private Action
getConfigureSymbolsAction() {
1132 if (fConfigureSymbolsAction
!= null) {
1133 return fConfigureSymbolsAction
;
1136 fConfigureSymbolsAction
= new Action(Messages
.CallStackView_ConfigureSymbolProvidersText
) {
1139 SymbolProviderConfigDialog dialog
= new SymbolProviderConfigDialog(getSite().getShell(), getProviderPages());
1140 if (dialog
.open() == IDialogConstants
.OK_ID
) {
1146 fConfigureSymbolsAction
.setToolTipText(Messages
.CallStackView_ConfigureSymbolProvidersTooltip
);
1147 fConfigureSymbolsAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(IMPORT_BINARY_ICON_PATH
));
1148 fConfigureSymbolsAction
.setEnabled(false);
1150 return fConfigureSymbolsAction
;
1154 * @return an array of {@link ISymbolProviderPreferencePage} that will
1155 * configure the current traces
1157 private ISymbolProviderPreferencePage
[] getProviderPages() {
1158 List
<ISymbolProviderPreferencePage
> pages
= new ArrayList
<>();
1159 ITmfTrace trace
= getTrace();
1160 if (trace
!= null) {
1161 for (ITmfTrace subTrace
: getTracesToBuild(trace
)) {
1162 ISymbolProvider provider
= fSymbolProviders
.get(subTrace
);
1163 if (provider
!= null) {
1164 ISymbolProviderPreferencePage page
= provider
.createPreferencePage();
1171 return pages
.toArray(new ISymbolProviderPreferencePage
[pages
.size()]);
1175 * Update the enable status of the configure symbols action
1177 private void updateConfigureSymbolsAction() {
1178 ISymbolProviderPreferencePage
[] providerPages
= getProviderPages();
1179 getConfigureSymbolsAction().setEnabled(providerPages
.length
> 0);