Jonathan Perret wrote:
>Well mcount() is actually part of the profiler (the profiling library), so
>unless you plan on writing your own profiler from scratch there's not
>much point in providing an implementation.
>You're normally supposed to link with the profiling library, I think
>linking with -pg is supposed to do it. It also might need to use a
>special version of crt0 (that's what it does on Linux apparently) that
>initializes the profiling memory.
>In fact looking a bit more into it, it seems gcc's mcount lives in
>libgcc.a... All in all the profiling setup is not a piece of cake, it has
>to be done properly . Oh, and good luck profiling on the GBA
>hardware : where are you going to store the (huge) data set ?
>
The VisualBoy Advance emulator has support for profiling. The data set
is stored by the emulator and dumped to disk when the program exits.
It's a very nice feature, but I had trouble getting intelligible results
from nontrivial programs (e.g. the gprof reports were referencing functions
which were never called). Has anyone else used this feature?
GCC's |"-fprofile-arcs" feature could be implemented similarly, but I'm
not sure how useful it would be on the ARM target.
|
-Pete