<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY bgColor=#eaeaea>
<DIV>&nbsp;</DIV>
<DIV><FONT face=宋体 size=2>  Thank you for your kind help. However,my problem 
is&nbsp;to profile the&nbsp;shared libraries rather than&nbsp;to profile forking 
processes. gprof can not generate any information about these shared libraries, 
and i also seems problem when using sprof, which is said to be able to offer 
profiling statistics about dynamic loaded libraries.</FONT></DIV>
<DIV><FONT face=宋体 size=2>&nbsp;&nbsp;&nbsp;&nbsp;So, I think another way is to 
build these modules statically, but don't know how to. So can anyone help me 
with that? thanks for your time!</FONT></DIV>
<DIV><FONT face=宋体 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=宋体 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Jacqueline Zou</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=宋体 size=2>======== 2006-08-11&nbsp;14:56:12&nbsp;您在来信中写道: 
========</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>
<TABLE width="100%">
  <TBODY>
  <TR>
    <TD width="100%">
      <BLOCKQUOTE 
      style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">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 lang=x-western 
        style="FONT-SIZE: 16px; FONT-FAMILY: -moz-fixed">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></BLOCKQUOTE></TD></TR></TBODY></TABLE></FONT></DIV>
<DIV>
<P><FONT face=宋体 size=2>= = = = = = = = = = = = = = = = = = = = = = </FONT></P>
<P><FONT face=宋体 size=2>        致<BR>礼!</FONT></P>
<DIV>&nbsp;</DIV>
<DIV><FONT face=宋体 size=2>              Jia Zou</FONT></DIV>
<DIV><FONT face=宋体 size=2><FONT face=宋体 size=2>              </FONT><A 
href="mailto:zouj03@mails.tsinghua.edu.cn">zouj03@mails.tsinghua.edu.cn</A></FONT></DIV>
<DIV><FONT face=宋体 size=2>               2006-08-12</FONT></DIV>
<DIV>&nbsp;</DIV></DIV></BODY></HTML>