USER’S MANUAL__________________________________________________________________
408 _________________________________________________________________ M211322EN-D
D.3.7 Profiling with gprof
The GNU tools include the handy runtime profiler gprof. This tool works
in conjunction with the C-compiler, and analyzes statistics in the gmon.out
file that is produced when the running program exits. The RDA Makefiles
are already setup to build profiled versions of either the RVP8/Main or
RVP8/Proc executables. To do this, define one of the following
environment variables:
export PROFILE_RVP8MAIN="1"
export PROFILE_RVP8PROC="1"
Then do a "make clean" and "make install" in the SITE and OPEN portions
of the relevant tree. If you are profiling the RVP8 compute process, you
need to 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 and chaos follows. If you forget to specify the
solitary process option, the RVP8 forces it upon you anyway, but with a
warning message. The RVP8 does not let you profile both the Main and
Proc executables at the same time.
Since the rvp8 and rvp8proc executables are built from their OPEN
directories, running the profile analysis from within that directory allows
gprof to find its symbols, for example:
$ cd /home/operator/src/rda/rvp8proc/open
<Run the RVP8 for a while...>
$gprof rvp8proc –I ../site
D.4 Creating New Major Modes from Old Ones
Custom algorithms are added to the RVP8 by building on its concept of
Major Modes and Output Data Types. Each Major Mode defines all of the
methods that are required to compute each of the Output Data Types from
raw (I,Q) data. Therefore, by allowing users to define their own Major
Modes, one has all of the hooks required for full customization. You can
code up your own custom algorithms by making incremental changes to
one of the Vaisala models, or you can start from scratch and build
something completely unique.
The best way to create a custom major mode is usually to start with the
code for an existing one and incrementally modify it to include the new
features. The FFT mode, for example, is defined in the files
rvp8main/open/mt_fft.c and rvp8proc/open/ct_fft.c, each containing about
100 lines of boilerplate top-level definitions. Creating your new major
mode begins by copying this prototype code into separately named files in