Profiling with gprof

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
urchin
Posts: 121
Joined: Thu Jun 02, 2005 5:41 pm

Profiling with gprof

Post by urchin »

Here's a quick sample showing how to add gprof support to your application, which allows your function calls to be profiled.

http://urch.in/gprof/gprof.zip

When "gprof_cleanup()" is called, gmon.out will be written to the current directory. This file can be analysed using the gprof application which is part of binutils. Note that you will need a version of gprof that has MIPS bfd support enabled (trying building with "--enable-libbfd --enable-targets=mips*-*-elf*"). Also note that the standard binutils configure file does not build gprof for some platforms even though it should build OK.

Tyranid is currently looking into patching binutils so that gprof is built as part of the toolchain.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

I have updated the binutils patch, hopefully it will work for other platforms (only tested on x86 linux)
Post Reply