<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Great, it works, thanks very much.<div>I found it from Documentation, but I think FAQ page is more helpful.</div><div><br><div>> Date: Wed, 20 May 2015 22:32:27 -0400<br>> From: alexmonthy@voxpopuli.im<br>> To: portlet@outlook.com<br>> CC: mathieu.desnoyers@efficios.com; lttng-dev@lists.lttng.org<br>> Subject: Re: [lttng-dev] lttng function tracing nginx problem<br>> <br>> Hi,<br>> <br>> Is it possible that nginx forks other processes, and the main process <br>> stays there doing almost nothing? In such a case, you would need to also <br>> preload "liblttng-ust-fork.so", so that UST can follow through fork() <br>> calls. See the section USING LTTNG UST WITH DAEMONS of "man lttng-ust".<br>> <br>> Cheers,<br>> Alexandre<br>> <br>> <br>> On 2015-05-20 09:02 PM, gang li wrote:<br>> ><br>> > [quehan@localhost objs]$ file ./nginx<br>> > ./nginx: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xb7659abd6bd962b7033f3cc495ac8bb44ac9f044, not stripped<br>> ><br>> ><br>> ><br>> > CFLAGS = -finstrument-functions -pipe -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g<br>> > [quehan@localhost objs]$ nm ./nginx | grep __cyg_profile_func                 U __cyg_profile_func_enter@@GLIBC_2.2.5<br>> ><br>> ><br>> >                   U __cyg_profile_func_exit@@GLIBC_2.2.5<br>> > [quehan@localhost objs]$ cat /proc/2046/maps | grep lttng7f2298000000-7f2298009000 r-xp 00000000 fd:01 103870944                  /usr/lib/liblttng-ust-tracepoint.so.0.0.07f2298009000-7f2298208000 ---p 00009000 fd:01 103870944                  /usr/lib/liblttng-ust-tracepoint.so.0.0.07f2298208000-7f2298209000 r--p 00008000 fd:01 103870944                  /usr/lib/liblttng-ust-tracepoint.so.0.0.07f2298209000-7f229820a000 rw-p 00009000 fd:01 103870944                  /usr/lib/liblttng-ust-tracepoint.so.0.0.07f2298aaa000-7f2298af2000 r-xp 00000000 fd:01 103870951                  /usr/lib/liblttng-ust.so.0.0.07f2298af2000-7f2298cf2000 ---p 00048000 fd:01 103870951                  /usr/lib/liblttng-ust.so.0.0.07f2298cf2000-7f2298cf4000 r--p 00048000 fd:01 103870951                  /usr/lib/liblttng-ust.so.0.0.07f2298cf4000-7f2298cf9000 rw-p 0004a000 fd:01 103870951                  /usr/lib/liblttng-ust.so.0.0.07f2299d6a000-7f2299d6c000 r-xp 00000000 fd:01 103870981                  /usr/lib/liblttng-ust-cyg-profile-fast.so.0.0.07f2299d6c000-7f2299f6c000 ---p 00002000 fd:01 103870981                  /usr/lib/liblttng-ust-cyg-profile-fast.so.0.0.07f2299f6c000-7f2299f6d000 r--p 00002000 fd:01 103870981                  /usr/lib/liblttng-ust-cyg-profile-fast.so.0.0.07f2299f6d000-7f2299f6e000 rw-p 00003000 fd:01 103870981                  /usr/lib/liblttng-ust-cyg-profile-fast.so.0.0.07f229a18a000-7f229a18b000 r--s 00000000 00:11 18728                      /dev/shm/lttng-ust-wait-5-1000<br>> ><br>> ><br>> ><br>> ><br>> ><br>> > 7f229a18b000-7f229a18c000 r--s 00000000 00:11 18727                      /dev/shm/lttng-ust-wait-5<br>> ><br>> > Nginx is a very famous lightweight http server, and I use the latest lttng suits, I can't resolve this.<br>> ><br>> > Date: Wed, 20 May 2015 16:28:41 +0000<br>> > From: mathieu.desnoyers@efficios.com<br>> > To: portlet@outlook.com<br>> > CC: lttng-dev@lists.lttng.org<br>> > Subject: Re: [lttng-dev] lttng function tracing nginx problem<br>> ><br>> ><br>> > hi all,<br>> > I compile the nginx-1.4.7 with FLAG -finstrument-functions , and start nginx like this:<br>> > LD_PRELOAD=liblttng-ust-cyg-profile-fast.so  ./nginx<br>> > Then I use the command lttng list --userspace and got nothing like this:<br>> > UST events:-------------None<br>> > I don't understand why I can't get the func_exit/entry events from nginx.<br>> > Is the "ngix" executable a binary executable or a shell script ?<br>> ><br>> > Can you give us the output of "file ./ngix" ?<br>> ><br>> > You might want to try<br>> ><br>> > export LD_PRELOAD=liblttng-ust-cyg-profile-fast.so<br>> > ./ngix<br>> ><br>> > Thanks,<br>> ><br>> > Mathieu<br>> ><br>> ><br>> ><br>> > By the way, I test function tracing with a single c source file and works well, output like this:<br>> > UST events:-------------<br>> > PID: 4687 - Name: ./tt      lttng_ust_cyg_profile:func_exit (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)      lttng_ust_cyg_profile:func_entry (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)      lttng_ust_tracef:event (loglevel: TRACE_DEBUG (14)) (type: tracepoint)<br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> >        ust_baddr_statedump:soinfo (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint)<br>> ><br>> > Wishing for help.<br>> <br>> <br></div></div>                                         </div></body>
</html>