[Freeswitch-users] How to add profiler flag when making just one module

Tom C mel0torme at gmail.com
Tue Jul 3 09:38:52 MSD 2012


I'd like to build one module (mod_fifo) with the -pg compiler flag.  But my
inexperience with gcc makefiles is making it difficult.  :-)  Does anyone
have any info for doing profiling in a FreeSwitch module?

The only way I can get it to even compile with the profiling flag is to run
./configure to set the flag for ALL modules, then make mod_fifo, then
re-run configure to remove the flag.  My code:

$> export MOD_CFLAGS="-pg"
$> export CFLAGS="-pg"
$>  ./configure
$>  make mod_fifo
$>  # undo the changes so I don't screw up my entire build.
$>  export MOD_CFLAGS=
$>  export CFLAGS=
$>  ../configure

Unfortunately, ./configure takes about 40 minutes to run on my poor little
pogoplug, and then "make mod_fifo" feels the need to rebuild a bunch of
libraries with the -pg flag (which I don't want), which adds another 15
minutes.  In all, my script takes 105 minutes to run.

After all this, I can see the -pg flag in use when doing "make mod_fifo",
and -pg shows up in the relink_command in mod_fifo.la.  But it doesn't
create the profiling data file, so apparently the -pg didn't actually work.

I'm stumped.  :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120702/1307f3a6/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list