I have a program and I want to measure it performance but using gprof.now I want to add a -pg
flag in it. I have many different files makefile.am makefile.in configure
I install the program using following steps
./configure
make
make install
Now I have read somewhere that:
I am totally confused and want to ask two question
-pg
flag? In makefile.in or makefile.am as they both have different types of flag options? man gcc:
-pg Generate extra code to write profile information suitable for the
analysis program gprof. You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
It says it needs to be in CPPFLAGS
(used for both C and C++ code) and LDFLAGS
(unless non-standard variables are used). The standard way is to pass flags to configure
script:
$ ./configure CPPFLAGS=-pg LDFLAGS=-pg
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.