[lttng-dev] lttng function tracing nginx problem

gang li portlet at outlook.com
Wed May 20 22:55:26 EDT 2015


Great, it works, thanks very much.I found it from Documentation, but I think FAQ page is more helpful.
> Date: Wed, 20 May 2015 22:32:27 -0400
> From: alexmonthy at voxpopuli.im
> To: portlet at outlook.com
> CC: mathieu.desnoyers at efficios.com; lttng-dev at lists.lttng.org
> Subject: Re: [lttng-dev] lttng function tracing nginx problem
> 
> Hi,
> 
> Is it possible that nginx forks other processes, and the main process 
> stays there doing almost nothing? In such a case, you would need to also 
> preload "liblttng-ust-fork.so", so that UST can follow through fork() 
> calls. See the section USING LTTNG UST WITH DAEMONS of "man lttng-ust".
> 
> Cheers,
> Alexandre
> 
> 
> On 2015-05-20 09:02 PM, gang li wrote:
> >
> > [quehan at localhost objs]$ file ./nginx
> > ./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
> >
> >
> >
> > CFLAGS = -finstrument-functions -pipe -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g
> > [quehan at localhost objs]$ nm ./nginx | grep __cyg_profile_func                 U __cyg_profile_func_enter@@GLIBC_2.2.5
> >
> >
> >                   U __cyg_profile_func_exit@@GLIBC_2.2.5
> > [quehan at 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
> >
> >
> >
> >
> >
> > 7f229a18b000-7f229a18c000 r--s 00000000 00:11 18727                      /dev/shm/lttng-ust-wait-5
> >
> > Nginx is a very famous lightweight http server, and I use the latest lttng suits, I can't resolve this.
> >
> > Date: Wed, 20 May 2015 16:28:41 +0000
> > From: mathieu.desnoyers at efficios.com
> > To: portlet at outlook.com
> > CC: lttng-dev at lists.lttng.org
> > Subject: Re: [lttng-dev] lttng function tracing nginx problem
> >
> >
> > hi all,
> > I compile the nginx-1.4.7 with FLAG -finstrument-functions , and start nginx like this:
> > LD_PRELOAD=liblttng-ust-cyg-profile-fast.so  ./nginx
> > Then I use the command lttng list --userspace and got nothing like this:
> > UST events:-------------None
> > I don't understand why I can't get the func_exit/entry events from nginx.
> > Is the "ngix" executable a binary executable or a shell script ?
> >
> > Can you give us the output of "file ./ngix" ?
> >
> > You might want to try
> >
> > export LD_PRELOAD=liblttng-ust-cyg-profile-fast.so
> > ./ngix
> >
> > Thanks,
> >
> > Mathieu
> >
> >
> >
> > By the way, I test function tracing with a single c source file and works well, output like this:
> > UST events:-------------
> > 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)
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >        ust_baddr_statedump:soinfo (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint)
> >
> > Wishing for help.
> 
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150521/a178ce55/attachment.html>


More information about the lttng-dev mailing list