[go: up one dir, main page]

Menu

[f338fb]: / doc / how-to-profile.org  Maximize  Restore  History

Download this file

30 lines (21 with data), 786 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
* Compiling
Profiling with gprof requires the -pg compiler option for compiling
and linking. People have reported mixed success with profiling
shared libraries. It doesn't seem to work for me. So I have to
disable building shared libraries. With static libraries, the tests
don't compile. It's probably a configuration issue that should be
fixed. But for now, the tests need to be disabled.
cd <source root>
./configure CXXFLAGS=-pg --enable-shared=no --enable-unit-tests=no
* Building
Everything needs to be rebuilt, so
make clean
make
* Running
Run as usual.
cd vamos
./vamos <args>
* Reporting
gprof vamos > <output file>
With shared libraries, the actual executable is .libs/lt-vamos. So
in that case you'd give that as the argument to gprof.