This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: How do I get a profiled libstdc++?
Benjamin Kosnik <bkoz@redhat.com> writes:
| > I've been trying to profile a program which has a substantual amount
| > of its runtime in libstdc++. But try as I might, I can't get a copy of
| > libstdc++ to compile with profiling, get my program to link against
| > it, and have it generate a gmon.out that has frequency counts for the
| > code in libstdc++. It only partially works, generating call counts for
| > my program and the template functions in stdc++ that my program
| > invokes.
|
| to compile libstdc++ with profiling, you can do:
|
| make CXXFLAGS="-pg" all
|
| in the libstdc++ build directory.
and be sure you build only static arechive (the fun part, double
check the result of the build) and link only statically.
| When you say "only partially works," what other info were you expecting?
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.
-- Gaby