<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=GB2312" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Your post belongs to serdev. Here is a serdev post from Hendrik Scholz
some time back.<br>
g-)<br>
<br>
<div class="moz-text-flowed"
 style="font-family: -moz-fixed; font-size: 16px;" lang="x-western">Hi!
<br>
<br>
I'm about to profile our SER installation and since profiling
<br>
doesn't run out of the box here's a rough guide:
<br>
<br>
- you'll need to build SER from sources, thus get sources,
<br>
&nbsp; apply your patches and so on
<br>
- before compilation get this patch (for CVS HEAD):
<br>
&nbsp; <a class="moz-txt-link-freetext"
 href="http://dump.wormulon.net/patches/ser-profiling.diff">http://dump.wormulon.net/patches/ser-profiling.diff</a>
<br>
&nbsp; Call
<br>
&nbsp; $ patch -p0 &lt; ser-profiling.diff
<br>
&nbsp; from the SER base directory.
<br>
<br>
&nbsp; What it does it invoking monstartup() in each child process
<br>
&nbsp; since the profiling information get lost when fork()ing.
<br>
&nbsp; I added all childs including timer and fifoserver. If you are
<br>
&nbsp; only interested in certain worker processes you can cut down
<br>
&nbsp; the resource impact by selectively activating profiling.
<br>
- enable profiling in Makefile.defs
<br>
&nbsp; - Set both -DPROFILING and PROFILE=-pg
<br>
- compile and deploy as usual
<br>
- Before starting SER using your standard init script you need
<br>
&nbsp; to set an environment variable that acts as a prefix to all
<br>
&nbsp; profiling data files. If you don't set it you'll only get one
<br>
&nbsp; file for the main process.
<br>
&nbsp; # export GMON_OUT_PREFIX=testrun
<br>
&nbsp; The gmon files will be named testrun.&lt;PID&gt; with the PID
matching
<br>
&nbsp; $ serctl fifo ps
<br>
&nbsp; SER may change the current working directory and drop
<br>
&nbsp; privileges on the way therefore I suggest you invoke the init
<br>
&nbsp; script from the SER working directory (-w option) so you'll
<br>
&nbsp; end up with all files in one place.
<br>
- Run SER for a while.
<br>
&nbsp; Not all gmon files will show up immediately, though.
<br>
- You should now be able to get per-process statistics using
<br>
&nbsp; $ gprof /usr/sbin/ser testrun.&lt;PID&gt;
<br>
- If cummulative statistics are what you are looking for use
<br>
&nbsp; $ gprof -s /usr/sbin/ser testrun.*
<br>
&nbsp; to create a new gmon.out which contains statistics over all
<br>
&nbsp; processes.
<br>
<br>
I have yet to fully analyze the results.
<br>
<br>
Cheers (and YMMV),
<br>
&nbsp;Hendrik
<br>
<br>
<div class="moz-txt-sig"><span class="moz-txt-tag">--&nbsp;<br>
</span>freenet Cityline GmbH, Hamburger Chaussee 2-4, 24114 Kiel,
Germany
<br>
Phone: +49 (0)431 9020552, Fax: +49 (0)431 9020559
<br>
Internet: <a class="moz-txt-link-freetext" href="http://www.freenet.de">http://www.freenet.de</a>,
eMail: <a class="moz-txt-link-abbreviated"
 href="mailto:hendrik.scholz@freenet-ag.de">hendrik.scholz@freenet-ag.de</a>
<br>
_______________________________________________
<br>
Serdev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Serdev@lists.iptel.org">Serdev@lists.iptel.org</a>
<br>
<a class="moz-txt-link-freetext"
 href="http://lists.iptel.org/mailman/listinfo/serdev">http://lists.iptel.org/mailman/listinfo/serdev</a>
<br>
<br>
<br>
</div>
</div>
<br>
<br>
×޼Πwrote:
<blockquote cite="midDz939188869785.28566@mail4" type="cite">
  <pre wrap="">Hi, all!

I am currently involved in a research work which aims at optimizing the SIP stack, and we chose SER -0.9.6 as our researching platform. we need to profile SER to find out which part(parser? network? transactions? ) consumes the most CPU cycles. However, tools like gprof and Intel Vtune's sampling tool can not show any information about the functions in dynamically loaded modules, such as tm, registrar. So, a possible solution seems to build in these modules into the core statically.

I tried to do what the INSTALL doc says, compling with the following command:"make static_modules=tm PROFILE=-pg all", the final part of the result shows:
......
make[1]:***[callid.o] Error 1
make[1]: Leaving directory '/....../SER/ser-0.9.6/modules/tm'
gcc -Wl,-02 -Wl, -E -pg action.o crc.o .....modules/tm/dlg.o, modules/tm/h_table.o .....modules/tm/uac_unixsock.o -
gcc: modules/tm/callid.o:No such file or directory
gcc: modules/tm/h_table.o:No such file or directory
...
gcc: modules/tm/uac_unixsock.o:No such file or directory
make: **[ser] Error 1

And if I proceed to type: make install
the result shows:
sr_module.o(.text+0xbc): In function 'register_builtin_modules':
/.../ser-0.9.6/sr_module.c:89: undefined reference to 'tm_exports'
collect2:ld returned 1 exit status
make: ***[ser] Error 1

I am working with SER 0.9.6
And the linux kernel used in my machine is:
Linux 2.6.9-22.ELsmp 
the OS used is Redhat 9

if anyone has tried the same thing or knows the solution, please let me know.Thanks very very much!

Jacqueline Zou







_______________________________________________
Serusers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a>
<a class="moz-txt-link-freetext" href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers</a>


  </pre>
</blockquote>
</body>
</html>