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

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!

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: Invalid gmon file
at org.eclipse.linuxtools.gprof.parser.GmonDecoder.readHeader(G
at org.eclipse.linuxtools.gprof.view.GmonView.displayGprofView(
at org.eclipse.ui.internal.EditorManager$ va:701)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.EditorManager.openExternalEditor(Edi
at org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag
at org.eclipse.ui.internal.WorkbenchPage$ ava:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
at org.eclipse.ui.ide.IDE.openEditor(
at org.eclipse.ui.ide.IDE.openEditor(
at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileActio
at a:221)
at org.eclipse.ui.navigator.CommonNavigatorManager$
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener. open(
at org.eclipse.jface.viewers.StructuredViewer$
at org.eclipse.ui.internal.JFaceUtil$
at 5)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewe
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:258)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate
at org.eclipse.swt.widgets.EventTable.sendEvent( :84)
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch( :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$4( 38)
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault (
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(
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( 619)
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

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

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

There is 3 different format for gmon files:

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

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,

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

Current Time: Sun Oct 24 06:18:06 GMT 2021

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

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

Back to the top