Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Linux Tools Project » gprof view show no data on MingW/Windows(gprof view show no data on MingW/Windows)
gprof view show no data on MingW/Windows [message #629659] Wed, 29 September 2010 07:34 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: September 2010
Junior Member
Hi,

I am using Eclipse Helios, and have the binutils directory in my path. I have compiled and linked an application into app.exe, run it to generate the gmon.out, and finally run gprof app.exe gmon.out that prints some textual statistics
that seems ok.

I copied the app.exe and gmon.out into the eclipse workspace, and double click on gmon.out. The dialog box pops up, and I enter the filename for the app.exe.

Still, the gprof view is empty! Sometimes I get an "invalid binary format" messagebox, sometimes not. But I never get any profiling data to display in the gprof Eclipse view.

I use MingW on Windows.

Any suggestions are most welcome!

/John
Re: gprof view show no data on MingW/Windows [message #629716 is a reply to message #629659] Wed, 29 September 2010 11:11 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: September 2010
Junior Member
Additional date! After building with MingW on Windows using -pg, and running my app.exe, I get a gmon.out file as expected. using the command "gprof app.exe gmon.out", I get a nice profiling report printed as expected.

However, when I use the gpof Eclipse view and double click on the same gmon.out file, and point out app.exe, I get this errors in the Eclipse log:

java.io.IOException: Invalid gmon file
at org.eclipse.linuxtools.gprof.parser.GmonDecoder.readHeader(G monDecoder.java:131)
at org.eclipse.linuxtools.gprof.parser.GmonDecoder.read(GmonDec oder.java:114)
at org.eclipse.linuxtools.gprof.parser.GmonDecoder.read(GmonDec oder.java:104)
at org.eclipse.linuxtools.gprof.view.GmonView.displayGprofView( GmonView.java:200)
at org.eclipse.linuxtools.gprof.action.OpenGmonAction.open(Open GmonAction.java:55)
at org.eclipse.ui.internal.EditorManager$3.run(EditorManager.ja va:701)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.EditorManager.openExternalEditor(Edi torManager.java:694)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:668)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:638)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2860)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2768)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2760)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2707)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2691)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2682)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileActio n.java:99)
at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystem EditorAction.java:99)
at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.jav a:221)
at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(Commo nNavigatorManager.java:185)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener. open(OpenAndLinkWithEditorHelper.java:48)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:845)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:843)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1131)
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewe r.java:462)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1235)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:264)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:258)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:298)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)


Why can gprof. exe successfully read my gmon.out file, but the gprof Eclipse viewer cannot?

/John
Re: gprof view show no data on MingW/Windows [message #630824 is a reply to message #629716] Tue, 05 October 2010 08:04 Go to previous messageGo to next message
Xavier Raynaud is currently offline Xavier RaynaudFriend
Messages: 7
Registered: July 2009
Junior Member
It looks like similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=315027


There is 3 different format for gmon files:

o MAGIC
o BSD
o BSD44

It seems that cygwin/mingW generates BSD gmon files.

Unfortunately, for now, eclipse plug-in only support MAGIC format, which is,
AFAIK, the default one on Linux.
Re: gprof view show no data on MingW/Windows [message #1734443 is a reply to message #630824] Wed, 08 June 2016 12:08 Go to previous message
Samuel BURG is currently offline Samuel BURGFriend
Messages: 1
Registered: June 2016
Junior Member
Hello,

gmon.out files in BSD format are supported by Eclipse-CDT under Windows + MinGW,
but only when generated from 32bits gcc with 32bits libs.

gmon.out files in 64 bits BSD format are currently not supported by Eclipse CDT + Windows + MinGW, even if the gmon.out file can still be read and analized from command line with gprof.

I have extensively tested 32-64 bits alternatives with different versions of Eclipse (Kepler, Luna, Mars) and GCC (old 32b MinGW, new 64b MinGW, 32b TDM_GCC, 64b TDM_GCC).

For now, the workaround is to build your 'Debug' with a 32b GCC and build your 'Release' with a 64b GCC. This can be achieved using the 'MINGW_HOME' environement variable : this variable can be adjust at a project-configuration level :
Properties -> C/C++Build -> Environement -> MINGW_HOME.
So, you can have a default 64b GCC/MinGW install for Release build, and a side 32b GCC used only for debuging and for gprof.

best regards,

Samuel
Previous Topic:Gcov: selecting binary
Next Topic:Reading gcda files
Goto Forum:
  


Current Time: Fri Mar 29 10:38:08 GMT 2024

Powered by FUDForum. Page generated in 0.02933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top