[ECOS] Issue with gprof

Gary Thomas gary@mlbassoc.com
Tue Jun 26 06:54:00 GMT 2007

Hash: SHA1

Picque Sébastien wrote:
> Hi,
> I got a gmon.out from my target, but it seems to be impossible to extract the data.
> he gmon.out is received via tftp.
> When I run the command (under cygwin) : gprof gmon.out  
>   result : gprof: gmon.out : not in a.out format 
> What does it mean ?
> gprof dhrystone
> no such file or directory

Look at how to run 'gprof':
$ gprof -h
Usage: gprof [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]
        [-d[num]] [-k from/to] [-m min-count] [-t table-length]
        [--[no-]annotated-source[=name]] [--[no-]exec-counts[=name]]
        [--[no-]flat-profile[=name]] [--[no-]graph[=name]]
        [--[no-]time=name] [--all-lines] [--brief] [--debug[=level]]
        [--function-ordering] [--file-ordering]
        [--directory-path=dirs] [--display-unused-functions]
        [--file-format=name] [--file-info] [--help] [--line] [--min-count=n]
        [--no-static] [--print-path] [--separate-files]
        [--static-call-graph] [--sum] [--table-length=len] [--traditional]
        [--version] [--width=n] [--ignore-non-functions]
        [--no-demangle] [--demangler=dso:function] [@FILE]
        [image-file] [profile-file...]

You need to provide it with both the executable program (eCos ELF application)
and the profile data.  Something like:

  $ gprof dhry gmon.out

Where 'dhry' is the name of the [ELF] program that you loaded and ran
on your platform, and 'gmon.out' is the profile result.

> Could somebody tell me what is wrong with it ? Moreover, by opening the gmon.out file (it looks to have almost every byte to  0)

The 'gmon.out' file is just a histogram of your program's
execution.  Depending on how long it runs, the granularity
of your profile clock and how the profile was gathered (e.g.
the size of the "buckets"), you may see lots of 0's and only
a few values non-zero.  Get 'gprof' to work and then see what
you're getting out.

- --
- ------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
- ------------------------------------------------------------
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list