Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364747

Summary: [Perf plug-in] Fixing behavior when no events occurred
Product: [Tools] Linux Tools Reporter: Daniel Henrique Barboza <danielhb>
Component: perfAssignee: Daniel Henrique Barboza <danielhb>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: obusatto, wainersm
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch implementing the proposed change
none
Patch implementing the proposed change - updated obusatto: iplog+

Description Daniel Henrique Barboza CLA 2011-11-24 14:23:12 EST
Build Identifier: 

Hello,

When profiling with Perf inside Eclipse, a blank screen appears when there was no events to be reported. This patch fixes it, showing the user a message saying that the profiling was completed but no events was generated to display.

Reproducible: Always
Comment 1 Daniel Henrique Barboza CLA 2011-11-24 14:24:56 EST
Created attachment 207501 [details]
Patch implementing the proposed change
Comment 2 Elliott Baron CLA 2011-11-24 18:50:19 EST
Not a Valgrind bug. Reassigning to Roland.
Comment 3 Elliott Baron CLA 2011-11-24 18:51:25 EST
Not a Valgrind bug. Reassigning to Roland.
Comment 4 Roland Grunberg CLA 2011-11-25 09:20:06 EST
Thanks, a new component for Perf will be made.
Comment 5 Otavio Pontes CLA 2011-11-28 11:34:03 EST
I applied the patch locally, I did some tests and I found a problem (at least it happened in my eclipse installation).

Steps to reproduce:
1. I did a Profile as->Perf and it worked fine.
2. I closed the 'Perf Profile View'
3. I did a Profile as->Profile Configurations, selected the Perf item, unchecked the 'Default Event' checkbox and checked the 'cpu-clock' checkbox in 'Software event' tab.
4. Clicked the Profile Button

Eclipse throws an exception and shows a warning dialog.

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
	at org.eclipse.swt.SWT.error(SWT.java:4282)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
	at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:960)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
	at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.launchInForeground(DebugUIPlugin.java:1022)
	at org.eclipse.debug.ui.DebugUITools.launch(DebugUITools.java:734)
	at org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.launch(ProfileLaunchShortcut.java:70)
	at org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.searchAndLaunch(ProfileLaunchShortcut.java:221)
	at org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut.launch(ProfileLaunchShortcut.java:63)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:434)
	at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:73)
	at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:121)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4282)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.SWT.error(SWT.java:4168)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:466)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:403)
	at org.eclipse.swt.widgets.Tree.getSelection(Tree.java:1716)
	at org.eclipse.jface.viewers.TreeViewer.getSelection(TreeViewer.java:256)
	at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:344)
	at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2521)
	at org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:2944)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1450)
	at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1404)
	at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1506)
	at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:537)
	at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1465)
	at org.eclipse.linuxtools.perf.ui.PerfProfileView.refreshModel(PerfProfileView.java:68)
	at org.eclipse.linuxtools.perf.PerfCore$2.run(PerfCore.java:514)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 46 more
Comment 6 Daniel Henrique Barboza CLA 2011-12-06 14:37:20 EST
Created attachment 208019 [details]
Patch implementing the proposed change - updated

Hello,

I have fixed that error, Otavio. Mind to take a look again?

Thanks!
Comment 7 Otavio Pontes CLA 2011-12-06 14:56:22 EST
(In reply to comment #6)
> Created attachment 208019 [details]
> Patch implementing the proposed change - updated
> 
> Hello,
> 
> I have fixed that error, Otavio. Mind to take a look again?

I just looked and committed that. The error was fixed. Thanks.
Commit: 0422f9168aba49e775c9d94684da36dcbd0da5e1

> 
> Thanks!