Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 61814 Details for
Bug 167995
Enhance Heap Statistics View
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Mar 23 patch - heap view fixes
org.eclipse.tptp.trace.jvmti.client_200703230000-patch (text/plain), 38.95 KB, created by
Ruslan Scherbakov
on 2007-03-23 09:04:57 EDT
(
hide
)
Description:
Mar 23 patch - heap view fixes
Filename:
MIME Type:
Creator:
Ruslan Scherbakov
Created:
2007-03-23 09:04:57 EDT
Size:
38.95 KB
patch
obsolete
>Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/UIMessages.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/UIMessages.java,v >retrieving revision 1.7 >diff -u -r1.7 UIMessages.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/UIMessages.java 16 Mar 2007 14:37:43 -0000 1.7 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/UIMessages.java 23 Mar 2007 12:59:09 -0000 >@@ -25,6 +25,13 @@ > public static String TIME_SCALE; > public static String MEM_ANALYSIS_TITLE; > public static String NO_THREAD_STATS; >+ public static String TI_CONTEXT_PROVIDER; >+ public static String CANNOT_OPEN_MEM_ANALYSIS; >+ public static String CANNOT_OPEN_THREAD_STATS; >+ public static String CANNOT_OPEN_THREAD_STATES; >+ public static String CANNOT_OPEN_CALL_STACK; >+ public static String DATA_NOT_SUPPORTED; >+ public static String EMPTY_PROFILE_SELECTION; > > // state strings > public static String _Not_Started; >@@ -80,10 +87,13 @@ > public static String _Delta; > public static String _ShowAsPercentage; > public static String _ShowDeltaColumns; >+ public static String _ShowCallStack; >+ public static String _Timescale; > public static String _MONITOR_OWNER; > public static String _TIMEOUT; > public static String _OBJECT_WAITING_FOR; > public static String _DURATION; >+ public static String _UNDEFINED_GROUP; > > private UIMessages() { > // Do not instantiate >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenMemoryAnalysisViewAction.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenMemoryAnalysisViewAction.java,v >retrieving revision 1.1 >diff -u -r1.1 OpenMemoryAnalysisViewAction.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenMemoryAnalysisViewAction.java 27 Feb 2007 18:37:33 -0000 1.1 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenMemoryAnalysisViewAction.java 23 Mar 2007 12:59:09 -0000 >@@ -35,4 +35,12 @@ > public String getViewID() { > return VIEW_ID; > } >+ >+ public String getErrorMsg() { >+ return UIMessages.CANNOT_OPEN_MEM_ANALYSIS; >+ } >+ >+ boolean acceptAgentName(String name) { >+ return name.equals("org.eclipse.tptp.jvmti"); >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/AllocationDetailsView.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/AllocationDetailsView.java,v >retrieving revision 1.4 >diff -u -r1.4 AllocationDetailsView.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/AllocationDetailsView.java 16 Mar 2007 14:37:43 -0000 1.4 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/AllocationDetailsView.java 23 Mar 2007 12:59:08 -0000 >@@ -23,7 +23,6 @@ > import org.eclipse.hyades.models.trace.TRCMethod; > import org.eclipse.hyades.models.trace.TRCObjectAllocationAnnotation; > import org.eclipse.hyades.trace.ui.TraceViewerPage; >-import org.eclipse.hyades.trace.ui.internal.util.TString; > import org.eclipse.hyades.trace.views.util.internal.ColumnData; > import org.eclipse.hyades.ui.provisional.context.IContextLabelFormatProvider; > import org.eclipse.hyades.ui.util.GridUtil; >@@ -40,8 +39,18 @@ > import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextProvider; > import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils; > >+/** >+ * Allocation Details view provides allocation info for objects >+ * of specified type. >+ * >+ * @author Ruslan A. Scherbakov >+ * >+ */ > public class AllocationDetailsView extends BaseStatisticView { > >+ /** >+ * Column constants ids. >+ */ > static public final int AD_COL_METHOD_NAME = 0; > static public final int AD_COL_LINE_NO = 1; > static public final int AD_COL_CLASS_NAME = 2; >@@ -97,12 +106,6 @@ > ; > } > >- String formatPercent(int val, int max) { >- String s = max > 0 && max >= val ? >- TString.formatAsPercentage((double)val / (double)max) : ""; >- return s; >- } >- > public String getColumnText(Object element, int columnIndex) { > StatisticViewColumnInfo info = StatisticViewColumnInfo > .getStatisticTableColumnInfo(getTree().getColumn(columnIndex)); >@@ -115,6 +118,8 @@ > switch (pos) { > case AD_COL_METHOD_NAME: > label = allocSite.getMethodName(); >+ if (null == label) >+ label = "?"; > break; > case AD_COL_CLASS_NAME: > label = allocSite.getClassName(); >@@ -129,26 +134,26 @@ > if (noperc) > label = String.valueOf(allocSite._total); > else >- label = formatPercent(allocSite._total, _allocAll._total); >+ label = Utils.formatPercent(allocSite._total, _allocAll._total); > break; > case AD_COL_TOTAL_SIZE: > if (noperc) > label = String.valueOf(allocSite._totalSize); > else >- label = formatPercent(allocSite._totalSize, _allocAll._totalSize); >+ label = Utils.formatPercent(allocSite._totalSize, _allocAll._totalSize); > break; > case AD_COL_LIVE_INST: > if (noperc) > label = String.valueOf(allocSite._total - allocSite._collected); > else >- label = formatPercent(allocSite._total - allocSite._collected, >+ label = Utils.formatPercent(allocSite._total - allocSite._collected, > _allocAll._total - _allocAll._collected); > break; > case AD_COL_LIVE_SIZE: > if (noperc) > label = String.valueOf(allocSite._totalSize - allocSite._collectedSize); > else >- label = formatPercent(allocSite._totalSize - allocSite._collectedSize, >+ label = Utils.formatPercent(allocSite._totalSize - allocSite._collectedSize, > _allocAll._totalSize - _allocAll._collectedSize); > break; > case AD_COL_AVG_AGE: >@@ -161,7 +166,7 @@ > IContextLabelFormatProvider formatter = TIContextProvider.instance().getContextLabelFormatProvider(TIContextAttributes.CALL_SITE_AVG_AGE); > label = formatter.getDisplayStringFromElement(new Double(age), null, IContextLabelFormatProvider.MODE_COLUMN_CONTENT); > } else { >- label = formatPercent(allocSite._sumAges, _allocAll._sumAges); >+ label = Utils.formatPercent(allocSite._sumAges, _allocAll._sumAges); > } > break; > } >@@ -304,20 +309,19 @@ > // gather alloc sites by line No > for (int i = _nextIndex; i < lineNoLen; i++) { > Integer lineNo = (Integer) lineNumbers.get(i); >- AllocationSite allocSite = (AllocationSite) _allocSites.get(lineNo); >+ TRCMethod method = null; >+ long id = lineNo.intValue(); >+ if (i < methodsLen) { >+ method = (TRCMethod) methods.get(i); >+ id += method.getId() << 20; >+ } >+ Long siteId = new Long(id); >+ AllocationSite allocSite = (AllocationSite) _allocSites.get(siteId); > if (null == allocSite) { >- TRCMethod method = null; > int line = lineNo.intValue(); > // find corresponding method >- for (int j = 0; j < methodsLen; j++) { >- TRCMethod method0 = (TRCMethod) methods.get(j); >- if (line >= method0.getLineNo() && line <= method0.getLineNo() + method0.getLineCount()) { >- method = method0; >- break; >- } >- } > allocSite = new AllocationSite(line, method); >- _allocSites.put(lineNo, allocSite); >+ _allocSites.put(siteId, allocSite); > } > int j = i + i + 1; > if (j < objectsLen && objects.get(j) instanceof TRCFullTraceObject) { >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatisticViewer.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatisticViewer.java,v >retrieving revision 1.4 >diff -u -r1.4 ThreadStatisticViewer.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatisticViewer.java 27 Feb 2007 18:37:33 -0000 1.4 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatisticViewer.java 23 Mar 2007 12:59:09 -0000 >@@ -26,7 +26,7 @@ > import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants; > > public class ThreadStatisticViewer extends TraceViewer implements >- IContextViewer { >+ IContextViewer, ICallStackProvider { > > protected Action _chooseColumns; > protected Action _sortByColumn; >@@ -95,7 +95,8 @@ > } > > public void updateContext() { >- ContextUpdaterHelper.setCurrentFocusContextLanguage(getSelectedContext()); >+ ContextUpdaterHelper >+ .setCurrentFocusContextLanguage(getSelectedContext()); > _contextChanged = false; > } > >@@ -176,15 +177,15 @@ > _openCallStackView = new OpenCallStackViewAction(); > TracePluginImages.setImageDescriptors(_openCallStackView, > TracePluginImages.T_VIEW, "call_stack_view.gif"); >- _openCallStackView.setText("Show Call Stack"); >- _openCallStackView.setDescription("Open Call Stack view"); >- _openCallStackView.setToolTipText("Open Call Stack view"); >+ _openCallStackView.setText(UIMessages._ShowCallStack); >+ _openCallStackView.setDescription(UIMessages._ShowCallStack); >+ _openCallStackView.setToolTipText(UIMessages._ShowCallStack); > _openCallStackView.setEnabled(true); > > IMenuManager menum = getViewSite().getActionBars().getMenuManager(); > menum.add(_chooseColumns); > menum.add(_sortByColumn); >- //menum.add(_openCallStackView); >+ // menum.add(_openCallStackView); > > MenuManager submenu = new MenuManager(TraceUIMessages._222); > submenu.addMenuListener(getContextSelectionMenuListener()); >@@ -192,4 +193,13 @@ > > getViewSite().getActionBars().updateActionBars(); > } >+ >+ public Object getCallStack() { >+ if (!(getCurrentPage() instanceof ThreadStatisticPage)) >+ return null; >+ ThreadStatisticPage page = (ThreadStatisticPage) getCurrentPage(); >+ if (page.getControl() == null || page.getControl().isDisposed()) >+ return null; >+ return page.getView().getSelectedThread(); >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatesViewer.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatesViewer.java,v >retrieving revision 1.3 >diff -u -r1.3 ThreadStatesViewer.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatesViewer.java 27 Feb 2007 18:37:33 -0000 1.3 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/ThreadStatesViewer.java 23 Mar 2007 12:59:09 -0000 >@@ -20,11 +20,12 @@ > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.tptp.trace.jvmti.internal.client.TITracePlugin; > import org.eclipse.ui.IActionBars; > import org.eclipse.ui.plugin.AbstractUIPlugin; > >-public class ThreadStatesViewer extends TraceViewer { >+public class ThreadStatesViewer extends TraceViewer implements ICallStackProvider { > > public ThreadStatesViewer() { > } >@@ -139,4 +140,14 @@ > manager.add(_selectPrevThread); > manager.add(_selectNextThread); > } >+ >+ public Object getCallStack() { >+ if (!(getCurrentPage() instanceof ThreadStatesPage)) >+ return null; >+ ThreadStatesPage page = ((ThreadStatesPage) getCurrentPage()); >+ if (page.getControl() == null || page.getControl().isDisposed()) >+ return null; >+ IStructuredSelection sel = (IStructuredSelection) page.getSelection(); >+ return sel.getFirstElement(); >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/CallStackViewer.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/CallStackViewer.java,v >retrieving revision 1.3 >diff -u -r1.3 CallStackViewer.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/CallStackViewer.java 1 Mar 2007 17:53:15 -0000 1.3 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/CallStackViewer.java 23 Mar 2007 12:59:09 -0000 >@@ -25,7 +25,6 @@ > import org.eclipse.hyades.trace.ui.ViewSelectionChangedEvent; > import org.eclipse.jface.viewers.DoubleClickEvent; > import org.eclipse.jface.viewers.IDoubleClickListener; >-import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.viewers.ITreeContentProvider; > import org.eclipse.jface.viewers.LabelProvider; > import org.eclipse.jface.viewers.TreeSelection; >@@ -36,17 +35,99 @@ > import org.eclipse.swt.widgets.Composite; > import org.eclipse.tptp.trace.jvmti.internal.client.MethodDetails; > import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils; >+import org.eclipse.ui.IPartListener2; >+import org.eclipse.ui.IViewReference; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.IWorkbenchPartReference; >+import org.eclipse.ui.IWorkbenchWindow; > import org.eclipse.ui.part.ViewPart; > >+interface ICallStackProvider { >+ Object getCallStack(); >+} >+ > public class CallStackViewer extends ViewPart implements > IViewSelectionChangedListener { > > private TreeViewer _calStackCtrl; >+ ICallStackProvider _provider; > private Object _selection; >+ private PartListener _partListener; >+ private static final Object[] _empty = new Object[0]; > > public CallStackViewer() { > } > >+ class PartListener implements IPartListener2 { >+ >+ IWorkbenchWindow _window; >+ >+ PartListener() { >+ IWorkbench wb = UIPlugin.getDefault().getWorkbench(); >+ _window = wb.getActiveWorkbenchWindow(); >+ _window.getActivePage().addPartListener(this); >+ IViewReference refs[] = _window.getActivePage().getViewReferences(); >+ for (int i = 0; i < refs.length; i++) { >+ Object part = refs[i].getPart(false); >+ if (part instanceof ICallStackProvider) { >+ _provider = (ICallStackProvider) part; >+ update(); >+ break; >+ } >+ } >+ } >+ >+ void dispose() { >+ _window.getActivePage().removePartListener(this); >+ _window = null; >+ } >+ >+ void detach() { >+ if (_window != null) { >+ _window.getActivePage().removePartListener(this); >+ _window = null; >+ } >+ _provider = null; >+ } >+ >+ public void partActivated(IWorkbenchPartReference partRef) { >+ Object part = partRef.getPart(false); >+ if (part instanceof ICallStackProvider) { >+ _provider = (ICallStackProvider) part; >+ update(); >+ } >+ } >+ >+ public void partBroughtToTop(IWorkbenchPartReference partRef) { >+ } >+ >+ public void partClosed(IWorkbenchPartReference partRef) { >+ if (_provider == partRef.getPart(false)) { >+ _provider = null; >+ update(); >+ } >+ } >+ >+ public void partDeactivated(IWorkbenchPartReference partRef) { >+ } >+ >+ public void partHidden(IWorkbenchPartReference partRef) { >+ if (_provider == partRef.getPart(false)) { >+ _provider = null; >+ update(); >+ } >+ } >+ >+ public void partInputChanged(IWorkbenchPartReference partRef) { >+ } >+ >+ public void partOpened(IWorkbenchPartReference partRef) { >+ } >+ >+ public void partVisible(IWorkbenchPartReference partRef) { >+ } >+ } >+ > public void createPartControl(Composite parent) { > _calStackCtrl = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.SINGLE); > _calStackCtrl.setContentProvider(new CallStackContentProvider()); >@@ -73,9 +154,11 @@ > }); > UIPlugin.getDefault().addViewSelectionChangedListener(this); > handleViewSelectionChangedEvent(UIPlugin.getDefault().getViewSelectionChangedEvent()); >+ _partListener = new PartListener(); > } > > public void dispose() { >+ _partListener.dispose(); > UIPlugin.getDefault().removeViewSelectionChangedListener(this); > super.dispose(); > } >@@ -85,6 +168,13 @@ > _calStackCtrl.getControl().setFocus(); > } > >+ void update() { >+ if (_provider != null) >+ update(_provider.getCallStack()); >+ else >+ update(null); >+ } >+ > /** update view content */ > void update(Object selection) { > if (null == _calStackCtrl) >@@ -116,8 +206,6 @@ > return obj.toString(); > } > >- static final Object[] _empty = new Object[0]; >- > class CallStackContentProvider implements ITreeContentProvider { > > public void inputChanged(Viewer v, Object oldInput, Object newInput) { >@@ -186,19 +274,6 @@ > } > > public void handleViewSelectionChangedEvent(ViewSelectionChangedEvent event) { >- Object source = event.getSource(); >- updateView(source); >- } >- >- public void updateView(Object source) { >- if (source instanceof ThreadStatisticView) { >- ThreadStatisticView view = (ThreadStatisticView) source; >- TRCThread thread = view.getSelectedThread(); >- update(thread); >- } else if (source instanceof ThreadStatesPage) { >- ThreadStatesPage page = (ThreadStatesPage) source; >- IStructuredSelection sel = (IStructuredSelection) page.getSelection(); >- update(sel.getFirstElement()); >- } >+ update(); > } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenTraceViewActionBase.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenTraceViewActionBase.java,v >retrieving revision 1.1 >diff -u -r1.1 OpenTraceViewActionBase.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenTraceViewActionBase.java 14 Feb 2007 17:03:09 -0000 1.1 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenTraceViewActionBase.java 23 Mar 2007 12:59:09 -0000 >@@ -17,13 +17,14 @@ > import org.eclipse.core.resources.IResourceStatus; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.hyades.trace.ui.TraceViewer; > import org.eclipse.hyades.trace.ui.UIPlugin; > import org.eclipse.hyades.trace.views.actions.internal.OpenTraceViewAction; >-import org.eclipse.hyades.trace.views.internal.TraceUIMessages; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils; > import org.eclipse.ui.IViewPart; > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.IWorkbenchWindow; >@@ -41,10 +42,39 @@ > public OpenTraceViewActionBase(String label, ImageDescriptor image) { > super(label, image); > } >+ >+ boolean acceptAgentName(String name) { >+ return true; >+ } >+ >+ public abstract String getErrorMsg(); > > void openView(boolean showError) { > IWorkbenchWindow window = UIPlugin.getDefault().getWorkbench() > .getActiveWorkbenchWindow(); >+ >+ // check profiler type >+ EObject mofObject = getMofObject(); >+ if (mofObject == null) { >+ if (showError) { >+ String msg = UIMessages.EMPTY_PROFILE_SELECTION; >+ Status err = new Status(Status.WARNING, >+ ResourcesPlugin.PI_RESOURCES, msg); >+ ErrorDialog.openError(window.getShell(), msg, "", err); >+ } >+ return; >+ } >+ String name = Utils.getAgentName(mofObject); >+ if (!acceptAgentName(name)) { >+ if (showError) { >+ String msg = UIMessages.DATA_NOT_SUPPORTED; >+ Status err = new Status(Status.WARNING, >+ ResourcesPlugin.PI_RESOURCES, msg); >+ ErrorDialog.openError(window.getShell(), msg, "", err); >+ } >+ return; >+ } >+ > try { > IWorkbenchPage persp = UIPlugin.getActivePage(); > IViewPart view = persp.showView(getViewID()); >@@ -53,7 +83,7 @@ > } > } catch (Exception e) { > if (showError) { >- String msg = TraceUIMessages._3; >+ String msg = getErrorMsg(); > Status err = new Status(Status.WARNING, > ResourcesPlugin.PI_RESOURCES, > IResourceStatus.INTERNAL_ERROR, e.toString(), null); >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatesViewAction.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatesViewAction.java,v >retrieving revision 1.2 >diff -u -r1.2 OpenThreadStatesViewAction.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatesViewAction.java 14 Feb 2007 17:03:09 -0000 1.2 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatesViewAction.java 23 Mar 2007 12:59:09 -0000 >@@ -35,4 +35,8 @@ > public String getViewID() { > return VIEW_ID; > } >+ >+ public String getErrorMsg() { >+ return UIMessages.CANNOT_OPEN_THREAD_STATES; >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/messages.properties,v >retrieving revision 1.7 >diff -u -r1.7 messages.properties >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/messages.properties 16 Mar 2007 14:37:43 -0000 1.7 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/messages.properties 23 Mar 2007 12:59:10 -0000 >@@ -21,6 +21,14 @@ > TIME_SCALE = Time Scale > MEM_ANALYSIS_TITLE = Memory Analysis > NO_THREAD_STATS = No thread statistics is available for display.\nEither you have no trace selected in the Profiling Monitor view or the current selection does not contain thread statistics information.\n\nNote:\nThis view is available only if the trace contains thread statistics. To collect this type of information, on the Profile tab in the Launch configuration, choose the Thread Statistics option. >+TI_CONTEXT_PROVIDER = JVMTI profiler context provider >+CANNOT_OPEN_MEM_ANALYSIS = Error opening the Memory Analysis view. >+CANNOT_OPEN_THREAD_STATS = Error opening the Thread Statistics view. >+CANNOT_OPEN_THREAD_STATES = Error opening the Threads Visualizer view. >+CANNOT_OPEN_CALL_STACK = Error opening the Call Stack view. >+DATA_NOT_SUPPORTED = The collected data is not supported by JVMTI profiler views. >+EMPTY_PROFILE_SELECTION = No trace is selected in the Profiling Monitor view. >+ > _Not_Started = Not Started > _Running = Running > _Sleeping = Sleeping >@@ -73,7 +81,10 @@ > _Delta = Delta > _ShowAsPercentage = Show as Percentage > _ShowDeltaColumns = Show Delta Columns >+_ShowCallStack = Show Call Stack >+_Timescale = Time scale > _THREAD_MONITOR = Monitor > _MONITOR_OWNER = Monitor Owner > _TIMEOUT = Timeout > _OBJECT_WAITING_FOR = Object Waiting For >+_UNDEFINED_GROUP = <undefined> >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatisticViewAction.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatisticViewAction.java,v >retrieving revision 1.2 >diff -u -r1.2 OpenThreadStatisticViewAction.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatisticViewAction.java 13 Feb 2007 20:44:43 -0000 1.2 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenThreadStatisticViewAction.java 23 Mar 2007 12:59:09 -0000 >@@ -7,25 +7,15 @@ > * $Id: OpenThreadStatisticViewAction.java,v 1.2 2007/02/13 20:44:43 ewchan Exp $ > * > **********************************************************************/ >+ > package org.eclipse.tptp.trace.jvmti.internal.client.views; > >-import org.eclipse.core.resources.IResourceStatus; >-import org.eclipse.core.resources.ResourcesPlugin; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.hyades.trace.ui.UIPlugin; >-import org.eclipse.hyades.trace.views.actions.internal.OpenTraceViewAction; >-import org.eclipse.hyades.trace.views.internal.TraceUIMessages; >-import org.eclipse.jface.action.IAction; >-import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.resource.ImageDescriptor; >-import org.eclipse.ui.IViewPart; >-import org.eclipse.ui.IWorkbenchPage; >-import org.eclipse.ui.IWorkbenchWindow; > >-public class OpenThreadStatisticViewAction extends OpenTraceViewAction { >+public class OpenThreadStatisticViewAction extends OpenTraceViewActionBase { >+ >+ static final String VIEW_ID = "org.eclipse.tptp.trace.jvmti.internal.client.views.ThreadStatisticViewer"; > >- static final String VIEW_ID="org.eclipse.tptp.trace.jvmti.internal.client.views.ThreadStatisticViewer"; >- > public OpenThreadStatisticViewAction() { > super(""); > } >@@ -38,50 +28,11 @@ > super(label, image); > } > >- public boolean isVisibleForType(Object mofObject) { >- return true; >- } >- >- /** >- * @see org.eclipse.jface.action.IAction#run() >- */ >- public void run() { >- IWorkbenchWindow window = >- UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); >- >- try { >- IWorkbenchPage persp = UIPlugin.getActivePage(); >- IViewPart view = persp.showView(VIEW_ID); >- >- if(view != null && view instanceof ThreadStatisticViewer) { >- ((ThreadStatisticViewer)view).addViewPage(getMofObject(), true); >- } >- >- } catch (Exception e) { >- String msg = >- TraceUIMessages._3; >- Status err = >- new Status( >- Status.WARNING, >- ResourcesPlugin.PI_RESOURCES, >- IResourceStatus.INTERNAL_ERROR, >- e.toString(), >- null); >- >- ErrorDialog.openError(window.getShell(), msg, "", >- // no special message >- err); >- >- e.printStackTrace(); >- } >- >- } >- >- public void run(IAction action) { >- run(); >- } >- > public String getViewID() { > return VIEW_ID; > } >+ >+ public String getErrorMsg() { >+ return UIMessages.CANNOT_OPEN_THREAD_STATS; >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenCallStackViewAction.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenCallStackViewAction.java,v >retrieving revision 1.3 >diff -u -r1.3 OpenCallStackViewAction.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenCallStackViewAction.java 27 Feb 2007 18:37:33 -0000 1.3 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/views/OpenCallStackViewAction.java 23 Mar 2007 12:59:09 -0000 >@@ -35,4 +35,8 @@ > public String getViewID() { > return VIEW_ID; > } >+ >+ public String getErrorMsg() { >+ return UIMessages.CANNOT_OPEN_CALL_STACK; >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/ThreadStatesCtrl.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/ThreadStatesCtrl.java,v >retrieving revision 1.3 >diff -u -r1.3 ThreadStatesCtrl.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/ThreadStatesCtrl.java 27 Feb 2007 18:37:36 -0000 1.3 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/ThreadStatesCtrl.java 23 Mar 2007 12:59:10 -0000 >@@ -45,6 +45,7 @@ > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.tptp.trace.jvmti.internal.client.views.UIMessages; > > public class ThreadStatesCtrl extends TraceCtrl implements FocusListener, > KeyListener, MouseMoveListener, MouseListener, ControlListener, >@@ -1062,7 +1063,7 @@ > public void refreshData(Object threads[]) { > clearGroups(); > _threads = threads; >- String undef = "<undefined>"; >+ String undef = UIMessages._UNDEFINED_GROUP; > ArrayList groupList = new ArrayList(); > for (int i = 0; i < _threads.length; i++) { > TRCThread thread = (TRCThread) _threads[i]; >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/TimeScaleCtrl.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/TimeScaleCtrl.java,v >retrieving revision 1.2 >diff -u -r1.2 TimeScaleCtrl.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/TimeScaleCtrl.java 27 Feb 2007 18:37:36 -0000 1.2 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/TimeScaleCtrl.java 23 Mar 2007 12:59:10 -0000 >@@ -23,6 +23,7 @@ > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.tptp.trace.jvmti.internal.client.views.UIMessages; > > public class TimeScaleCtrl extends TraceCtrl implements MouseListener, MouseMoveListener { > >@@ -137,9 +138,9 @@ > _rect0.width -= 4; > if (_rect0.width > 0) { > if (false && rect.width - leftSpace > 0) >- Utils.drawText(gc, "Time scale: " + timeDraw.hint(), _rect0, true); >+ Utils.drawText(gc, UIMessages._Timescale + ": " + timeDraw.hint(), _rect0, true); > else >- Utils.drawText(gc, "Time scale:", _rect0, true); >+ Utils.drawText(gc, UIMessages._Timescale + ":", _rect0, true); > } > _rect0.x -= 4; > _rect0.width += 4; >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/Utils.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/Utils.java,v >retrieving revision 1.6 >diff -u -r1.6 Utils.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/Utils.java 16 Mar 2007 14:37:45 -0000 1.6 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/widgets/Utils.java 23 Mar 2007 12:59:10 -0000 >@@ -18,7 +18,10 @@ > > import org.eclipse.emf.common.util.EList; > import org.eclipse.emf.ecore.EObject; >+import org.eclipse.hyades.models.hierarchy.TRCAgentProxy; > import org.eclipse.hyades.models.hierarchy.TRCAnnotation; >+import org.eclipse.hyades.models.hierarchy.TRCNode; >+import org.eclipse.hyades.models.hierarchy.TRCProcessProxy; > import org.eclipse.hyades.models.trace.TRCClass; > import org.eclipse.hyades.models.trace.TRCFullTraceObject; > import org.eclipse.hyades.models.trace.TRCGCEvent; >@@ -36,6 +39,7 @@ > import org.eclipse.hyades.models.trace.TRCThreadWaitingForObjectEvent; > import org.eclipse.hyades.trace.ui.ITraceSelection; > import org.eclipse.hyades.trace.ui.UIPlugin; >+import org.eclipse.hyades.trace.ui.internal.util.TString; > import org.eclipse.hyades.trace.ui.internal.util.TraceMessages; > import org.eclipse.hyades.trace.views.internal.TraceUIMessages; > import org.eclipse.hyades.trace.views.internal.TraceUIPlugin; >@@ -694,7 +698,7 @@ > return age; > } > >- public static int compare(double d1, double d2) { >+ static public int compare(double d1, double d2) { > if (d1 > d2) > return 1; > if (d1 < d2) >@@ -702,7 +706,7 @@ > return 0; > } > >- public static int compare(String s1, String s2) { >+ static public int compare(String s1, String s2) { > if (s1 != null && s2 != null) > return s1.compareToIgnoreCase(s2); > if (s1 != null) >@@ -711,4 +715,25 @@ > return -1; > return 0; > } >+ >+ static public String getAgentName(EObject mofObject) { >+ String name = ""; >+ EList list = null; >+ if (mofObject instanceof TRCAgentProxy) { >+ name = ((TRCAgentProxy) mofObject).getName(); >+ } else if (mofObject instanceof TRCProcessProxy) { >+ list = ((TRCProcessProxy) mofObject).getAgentProxies(); >+ } else if (mofObject instanceof TRCNode) { >+ list = ((TRCNode) mofObject).getProcessProxies(); >+ } >+ if (list != null && list.size() > 0) >+ name = getAgentName((EObject) list.get(0)); >+ return name; >+ } >+ >+ static public String formatPercent(int val, int max) { >+ String s = max > 0 && max >= val ? >+ TString.formatAsPercentage((double)val / (double)max) : ""; >+ return s; >+ } > } >Index: src/org/eclipse/tptp/trace/jvmti/internal/client/context/TIContextProvider.java >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/src/org/eclipse/tptp/trace/jvmti/internal/client/context/TIContextProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 TIContextProvider.java >--- src/org/eclipse/tptp/trace/jvmti/internal/client/context/TIContextProvider.java 12 Mar 2007 14:51:25 -0000 1.2 >+++ src/org/eclipse/tptp/trace/jvmti/internal/client/context/TIContextProvider.java 23 Mar 2007 12:59:08 -0000 >@@ -20,6 +20,7 @@ > > import org.eclipse.hyades.trace.views.internal.context.java.BasicContextProvider; > import org.eclipse.hyades.ui.provisional.context.IContextLabelFormatProvider; >+import org.eclipse.tptp.trace.jvmti.internal.client.views.UIMessages; > > public class TIContextProvider extends BasicContextProvider implements TIContextAttributes { > >@@ -112,7 +113,7 @@ > } > > public String getName() { >- return "JVMTI profiler context provider"; >+ return UIMessages.TI_CONTEXT_PROVIDER; > } > > public String[] getSupportAttributes() { >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/plugin.properties,v >retrieving revision 1.9 >diff -u -r1.9 plugin.properties >--- plugin.properties 16 Mar 2007 14:37:43 -0000 1.9 >+++ plugin.properties 23 Mar 2007 12:59:08 -0000 >@@ -27,8 +27,8 @@ > JVMTI_ANALYSIS_TYPE_VIEW_THRD_STATES = Threads Visualizer > JVMTI_ANALYSIS_TYPE_VIEW_CALL_STACK = Call Stack > JVMTI_ANALYSIS_TYPE_VIEW_HEAP = Memory Statistics >-JVMTI_ANALYSIS_TYPE_VIEW_HEAP_ANALYSIS = Memory Analysis >-JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD = Open Thread Statistics >-JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD_STATES = Open Threads Visualizer >-JVMTI_ANALYSIS_TYPE_TOOLTIP_CALL_STACK = Open Call Stack >-JVMTI_ANALYSIS_TYPE_TOOLTIP_HEAP_ANALYSIS = Open Memory Analysis >+JVMTI_ANALYSIS_TYPE_VIEW_HEAP_ANALYSIS = Object Allocations >+JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD = Open Thread Statistics view >+JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD_STATES = Open Threads Visualizer view >+JVMTI_ANALYSIS_TYPE_TOOLTIP_CALL_STACK = Open Call Stack view >+JVMTI_ANALYSIS_TYPE_TOOLTIP_HEAP_ANALYSIS = Open Object Allocations view >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tptp/trace/org.eclipse.tptp.trace.jvmti.client/plugin.xml,v >retrieving revision 1.11 >diff -u -r1.11 plugin.xml >--- plugin.xml 16 Mar 2007 14:37:43 -0000 1.11 >+++ plugin.xml 23 Mar 2007 12:59:08 -0000 >@@ -79,7 +79,7 @@ > <analyzerExtension > class="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatisticViewAction" > extension="trace" >- icon="icons/full/obj16/thread.gif" >+ icon="icons/full/cview16/thread_stat_view.gif" > id="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatisticViewAction" > name="%JVMTI_ANALYSIS_TYPE_VIEW_THRD" > type="org.eclipse.tptp.analysisType.jvmti.thread"/> >@@ -105,7 +105,7 @@ > point="org.eclipse.ui.views"> > <view > name="%JVMTI_ANALYSIS_TYPE_VIEW_THRD" >- icon="icons/full/obj16/thread.gif" >+ icon="icons/full/cview16/thread_stat_view.gif" > category="org.eclipse.hyades.trace.internal.ui.trace" > class="org.eclipse.tptp.trace.jvmti.internal.client.views.ThreadStatisticViewer" > id="org.eclipse.tptp.trace.jvmti.internal.client.views.ThreadStatisticViewer"> >@@ -118,18 +118,18 @@ > name="%JVMTI_ANALYSIS_TYPE_VIEW_THRD_STATES"/> > <view > category="org.eclipse.hyades.trace.internal.ui.trace" >- class="org.eclipse.tptp.trace.jvmti.internal.client.views.CallStackViewer" >- icon="icons/full/cview16/call_stack_view.gif" >- id="org.eclipse.tptp.trace.jvmti.internal.client.views.CallStackViewer" >- name="%JVMTI_ANALYSIS_TYPE_VIEW_CALL_STACK"> >- </view> >- <view >- category="org.eclipse.hyades.trace.internal.ui.trace" > class="org.eclipse.tptp.trace.jvmti.internal.client.views.MemoryAnalysisViewer" > icon="icons/full/obj16/memleakantype_obj.gif" > id="org.eclipse.tptp.trace.jvmti.internal.client.views.MemoryAnalysisViewer" > name="%JVMTI_ANALYSIS_TYPE_VIEW_HEAP_ANALYSIS"> > </view> >+ <view >+ category="org.eclipse.hyades.trace.internal.ui.trace" >+ class="org.eclipse.tptp.trace.jvmti.internal.client.views.CallStackViewer" >+ icon="icons/full/cview16/call_stack_view.gif" >+ id="org.eclipse.tptp.trace.jvmti.internal.client.views.CallStackViewer" >+ name="%JVMTI_ANALYSIS_TYPE_VIEW_CALL_STACK"> >+ </view> > </extension> > > <extension >@@ -149,6 +149,12 @@ > visible="false"> > </view> > <view >+ id="org.eclipse.tptp.trace.jvmti.internal.client.views.MemoryAnalysisViewer" >+ relationship="stack" >+ relative="org.eclipse.hyades.trace.views.adapter.internal.ExecutionStatisticViewer2" >+ visible="false"> >+ </view> >+ <view > id="org.eclipse.tptp.trace.jvmti.internal.client.views.CallStackViewer" > relationship="bottom" > relative="org.eclipse.tptp.trace.jvmti.internal.client.views.ThreadStatesViewer" >@@ -171,7 +177,8 @@ > id="org.eclipse.tptp.trace.jvmti.threadActionSet"> > <action > class="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenCallStackViewAction" >- icon="icons/full/cview16/call_stack_view.gif" >+ disabledIcon="icons/full/dtool16/callstack.gif" >+ icon="icons/full/etool16/callstack.gif" > id="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenCallStackViewAction" > label="%JVMTI_ANALYSIS_TYPE_VIEW_CALL_STACK" > style="push" >@@ -189,19 +196,21 @@ > </action> > <action > class="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatesViewAction" >- icon="icons/full/cview16/thread_states_view.gif" >+ disabledIcon="icons/full/dtool16/thread_state.gif" >+ icon="icons/full/etool16/thread_state.gif" > id="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatesViewAction" > label="%JVMTI_ANALYSIS_TYPE_VIEW_THRD_STATES" > style="push" > toolbarPath="trace/group.statistic" > tooltip="%JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD_STATES"/> > <action >- label="%JVMTI_ANALYSIS_TYPE_VIEW_THRD" >- icon="icons/full/obj16/thread.gif" >- tooltip="%JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD" > class="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatisticViewAction" >+ disabledIcon="icons/full/dtool16/thread_stat.gif" >+ icon="icons/full/etool16/thread_stat.gif" >+ id="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatisticViewAction" >+ label="%JVMTI_ANALYSIS_TYPE_VIEW_THRD" > toolbarPath="trace/group.statistic" >- id="org.eclipse.tptp.trace.jvmti.internal.client.views.OpenThreadStatisticViewAction"> >+ tooltip="%JVMTI_ANALYSIS_TYPE_TOOLTIP_THRD"> > </action> > </actionSet> > </extension>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 167995
:
59470
|
60265
|
61066
| 61814 |
61815