This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How do I get a profiled libstdc++?


> The shared library did not "work" for me, when I tried with gcjx:  the
> profiler, for some reasons, cannot account for shared objects
> properly.  It would report the amont of time spend in crossing the
> DSO boundaries, but it would not report on the time spent doing libstdc++
> jobs.

I must admit I am using oprofile and valgrind-tools for all profiling now.

It's much easier, assuming you have root. 

Not only does it work with shared libs, but all the shared libs have
their own profiles, in individual files. Nice. Works without
recompiling... nicer.

Here is my cheat sheet/notes for oprofile commands. It's pretty dated
WRT machine arches but gives you an idea of the workflow.

For valgrind and friends, I use:


1) rebuild libstdc++ for debuggins
rm -rf *
make CXXFLAGS="-g -O0" all
make install

2) make sure this installed library has LD_LIBRARY_PATH, etc set so
that binaries compiled against it can find the libraries
automatically.

3) valgrind $VFLAGS a.out

where

%echo $VFLAGS
-v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes

sometimes you have to specify the memcheck tool to valgrind ie --tool=memcheck

For cachegrind, the docs are pretty good...

-benjamin

Attachment: oprofile_commands
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]