EasyManua.ls Logo

Vaisala RVP900 - Profiling with Gprof

Vaisala RVP900
484 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The most common problem that it solves is finding reads-before-writes, that is, when you
forget to set a value in a structure somewhere, and then reference it later before writing into
it. Malloc/Free inconsistencies are also easily diagnosed with valgrind.
valgrind is easy to use, because you run it on the executable being debugged in the same
way that ddd was used in the previous section. There are no special compiling or linking
requirements. To debug RVP9/Proc process, use:
$ cd /usr/sigmet/src/rda/rvp9proc/open
$ valgrind —tool=memcheck rvp9proc
You can download valgrind from http://valgrind.kde.org. .
C.3.7
Profiling with gprof
The GNU tools include the runtime profiler gprof.
This tool works with the C-compiler, and analyzes statistics in the gmon.out file that is
produced when the running program exits.
1. The RDA Makefiles are setup to build profiled versions of either RVP9/Main or
RVP9/Proc executables. Define one of the following environment variables:
export PROFILE_RVP9MAIN="1"
export PROFILE_RVP9PROC="1"
If you are
profiling RVP compute process, make sure that only one of them is forked
by including -procs 1 in the original startup command.
Otherwise, each sub-process attempts to create the same gmon.out.
RVP does not let you profile both the Main and Proc executables at the same time.
2. Perform a make clean and make install in the SITE and OPEN portions of the
relevant tree.
3. Run the profile analysis from the RVP and rvp9proc executables from their OPEN
directories to allow gprof to find its symbols.
For example:
$ cd /home/operator/src/rda/rvp9proc/open
<Run RVP for a while...>
$ gprof rvp9proc – I .. /site
Appendix C – RVP900 Developer Notes
381

Table of Contents

Other manuals for Vaisala RVP900